namespace Civi\PhpStorm;
+use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
*
* @link https://www.jetbrains.com/help/phpstorm/2021.3/ide-advanced-metadata.html
*/
-class Generator {
+class PhpStormCompilePass implements CompilerPassInterface {
/**
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
* @return void
*/
- public static function generate(ContainerBuilder $container): void {
+ public function process(ContainerBuilder $container): void {
if (defined('CIVICRM_TEST')) {
return;
}
<angularModule>crmPhpstorm</angularModule>
</civix>
<mixins>
- <mixin>phpstorm@1.0.0</mixin>
<!--
<mixin>mgd-php@1.0.0</mixin>
<mixin>setting-php@1.0.0</mixin>
+++ /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);
-
-};
// phpcs:disable
// use CRM_Phpstorm_ExtensionUtil as E;
// phpcs:enable
+use Symfony\Component\DependencyInjection\Compiler\PassConfig;
/**
* Implements hook_civicrm_config().
// function phpstorm_civicrm_config(&$config): void {
// _phpstorm_civix_civicrm_config($config);
// }
+
+function phpstorm_civicrm_container(\Symfony\Component\DependencyInjection\ContainerBuilder $container) {
+ $container->addCompilerPass(new \Civi\PhpStorm\PhpStormCompilePass(), PassConfig::TYPE_AFTER_REMOVING, 2000);
+}