<format>23.02.1</format>
<angularModule>crmPhpstorm</angularModule>
</civix>
- <!-- <mixins>
+ <mixins>
+ <mixin>phpstorm@1.0.0</mixin>
+ <!--
<mixin>mgd-php@1.0.0</mixin>
<mixin>setting-php@1.0.0</mixin>
<mixin>smarty-v2@1.0.1</mixin>
- </mixins> -->
+ -->
+ </mixins>
</extension>
--- /dev/null
+<?php
+
+/**
+ * @mixinName phpstorm
+ * @mixinVersion 1.0.0
+ *
+ * @param CRM_Extension_MixInfo $mixInfo
+ * On newer deployments, this will be an instance of MixInfo. On older deployments, Civix may polyfill with a work-a-like.
+ * @param \CRM_Extension_BootCache $bootCache
+ * On newer deployments, this will be an instance of MixInfo. On older deployments, Civix may polyfill with a work-a-like.
+ */
+return function ($mixInfo, $bootCache) {
+
+ // We want to register a late-stage listener for hook_civicrm_container, but... it's a special hook.
+ // Therefore, we apply the Shenanigan technique.
+ Civi::dispatcher()->addListener('&hook_civicrm_container', function($container) use ($mixInfo) {
+ if ($mixInfo->isActive()) {
+ \Civi\PhpStorm\Generator::generate($container);
+ }
+ }, -2000);
+
+};
// function phpstorm_civicrm_config(&$config): void {
// _phpstorm_civix_civicrm_config($config);
// }
-
-/**
- * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
- * @return void
- * @see \CRM_Utils_Hook::container()
- */
-function phpstorm_civicrm_container($container): void {
- // Delegate pattern. There aren't many other ways to listen to this ehook.
- \Civi\PhpStorm\Generator::generate($container);
-}