Security update for Core, with self-updated composer
[yaffs-website] / vendor / consolidation / annotated-command / src / Hooks / Dispatchers / CommandEventHookDispatcher.php
index c89fd5c45aa911e03b6a361a48da964b13397332..0baead89e4790f01f0f8598a3cbce519caa81e35 100644 (file)
@@ -7,6 +7,7 @@ use Symfony\Component\Console\Command\Command;
 use Symfony\Component\Console\ConsoleEvents;
 use Symfony\Component\Console\Event\ConsoleCommandEvent;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 
 /**
  * Call hooks
@@ -25,6 +26,9 @@ class CommandEventHookDispatcher extends HookDispatcher
         ];
         $commandEventHooks = $this->getHooks($hooks);
         foreach ($commandEventHooks as $commandEvent) {
+            if ($commandEvent instanceof EventDispatcherInterface) {
+                $commandEvent->dispatch(ConsoleEvents::COMMAND, $event);
+            }
             if (is_callable($commandEvent)) {
                 $commandEvent($event);
             }