From 6d39767e62c381ea1bd836f24e0e57eb378c0e4e Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 25 Aug 2023 18:57:32 -0700 Subject: [PATCH] Use `hook_managed` to implement `civi.phpstorm.flush` --- tools/extensions/phpstorm/phpstorm.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/extensions/phpstorm/phpstorm.php b/tools/extensions/phpstorm/phpstorm.php index 320245c99c..1a8f9937bc 100644 --- a/tools/extensions/phpstorm/phpstorm.php +++ b/tools/extensions/phpstorm/phpstorm.php @@ -34,6 +34,15 @@ function phpstorm_civicrm_container(\Symfony\Component\DependencyInjection\Conta $container->addCompilerPass(new \Civi\PhpStorm\PhpStormCompilePass(), PassConfig::TYPE_AFTER_REMOVING, 2000); } +function phpstorm_civicrm_managed(&$entities, $modules) { + // We don't currently have an event for extensions to join the "system flush" operation. Apply Skullduggery method. + // This gives a useful baseline event for most generators -- but it's _not_ for "services", and each generator may be supplemented + // by other events. + if ($modules === NULL && !defined('CIVICRM_TEST')) { + Civi::dispatcher()->dispatch('civi.phpstorm.flush'); + } +} + function phpstorm_civicrm_uninstall() { $dir = phpstorm_metadata_dir(); if (file_exists($dir)) { -- 2.25.1