From a6ec43d8ff6ddb2b23325ecd3b09d3fd4c495e61 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sun, 25 Apr 2021 11:51:02 -0500 Subject: [PATCH] Allow plugins to run for enabled hooks even if no actions --- src/Runner/Hook.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Runner/Hook.php b/src/Runner/Hook.php index 4429e506..6a6bdfd2 100644 --- a/src/Runner/Hook.php +++ b/src/Runner/Hook.php @@ -125,13 +125,15 @@ public function run(): void $actions = $this->getActionsToExecute($hookConfigs); + $this->beforeHook(); + // if no actions are configured do nothing if (count($actions) === 0) { $this->io->write(['', 'No actions to execute'], true, IO::VERBOSE); - return; + } else { + $this->executeActions($actions); } - $this->beforeHook(); - $this->executeActions($actions); + $this->afterHook(); } @@ -448,7 +450,7 @@ private function executeRunnerPluginsFor(string $method, ?Config\Action $action $this->io->write(['', 'Executing plugins for: ' . $method . ''], true, IO::DEBUG); foreach ($plugins as $plugin) { - $this->io->write(get_class($plugin), true, IO::DEBUG); + $this->io->write('- Running ' . get_class($plugin) . '::' . $method . '', true, IO::DEBUG); $plugin->{$method}(...$params); } }