From aadb761d20210c4e30de178b7e85fd0799b939c7 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 25 Aug 2023 05:03:02 -0700 Subject: [PATCH] phpstorm - Move listener to the end of the hook --- tools/extensions/phpstorm/info.xml | 7 ++++-- .../phpstorm/mixin/phpstorm@1.0.0.mixin.php | 22 +++++++++++++++++++ tools/extensions/phpstorm/phpstorm.php | 10 --------- 3 files changed, 27 insertions(+), 12 deletions(-) create mode 100644 tools/extensions/phpstorm/mixin/phpstorm@1.0.0.mixin.php diff --git a/tools/extensions/phpstorm/info.xml b/tools/extensions/phpstorm/info.xml index 38449206f2..8f4f17f968 100644 --- a/tools/extensions/phpstorm/info.xml +++ b/tools/extensions/phpstorm/info.xml @@ -30,9 +30,12 @@ 23.02.1 crmPhpstorm - + --> + diff --git a/tools/extensions/phpstorm/mixin/phpstorm@1.0.0.mixin.php b/tools/extensions/phpstorm/mixin/phpstorm@1.0.0.mixin.php new file mode 100644 index 0000000000..c70b85be52 --- /dev/null +++ b/tools/extensions/phpstorm/mixin/phpstorm@1.0.0.mixin.php @@ -0,0 +1,22 @@ +addListener('&hook_civicrm_container', function($container) use ($mixInfo) { + if ($mixInfo->isActive()) { + \Civi\PhpStorm\Generator::generate($container); + } + }, -2000); + +}; diff --git a/tools/extensions/phpstorm/phpstorm.php b/tools/extensions/phpstorm/phpstorm.php index 450c7b3ea2..b7d7483201 100644 --- a/tools/extensions/phpstorm/phpstorm.php +++ b/tools/extensions/phpstorm/phpstorm.php @@ -13,13 +13,3 @@ // 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); -} -- 2.25.1