From e643c8bf9ccc0db4a9609b99ee323ac28c59db7b Mon Sep 17 00:00:00 2001 From: Maxime ALLORENT Date: Fri, 23 Jun 2023 14:04:14 +0200 Subject: [PATCH] fix compatibility to symfony 5 --- src/Domain/Consumer/Consumer.php | 4 ++-- src/Domain/EventDispatcherBus.php | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Domain/Consumer/Consumer.php b/src/Domain/Consumer/Consumer.php index f38341c..e6f5ef5 100644 --- a/src/Domain/Consumer/Consumer.php +++ b/src/Domain/Consumer/Consumer.php @@ -58,8 +58,8 @@ public function consume($command = null) } $this->eventDispatcher->dispatch( - Event\Events::ON_CONSUMER_RESPONSE, - new Event\OnConsumerResponseEvent($this->commandBus->getHandleType(), $response) + new Event\OnConsumerResponseEvent($this->commandBus->getHandleType(), $response), + Event\Events::ON_CONSUMER_RESPONSE ); return $response; diff --git a/src/Domain/EventDispatcherBus.php b/src/Domain/EventDispatcherBus.php index 81d8f62..e3caf2e 100644 --- a/src/Domain/EventDispatcherBus.php +++ b/src/Domain/EventDispatcherBus.php @@ -27,22 +27,22 @@ public function handle(CommandInterface $command, $priority = null) { try { $this->eventDispatcher->dispatch( - Event\Events::PRE_HANDLE_COMMAND, - new Event\PreHandleCommandEvent($this->getHandleType(), $command) + new Event\PreHandleCommandEvent($this->getHandleType(), $command), + Event\Events::PRE_HANDLE_COMMAND ); $result = $this->delegateCommandBus->handle($command, $priority); $this->eventDispatcher->dispatch( - Event\Events::ON_DIRECT_RESPONSE, - new Event\OnDirectResponseEvent($this->getHandleType(), new Response($command, Response::SUCCESS)) + new Event\OnDirectResponseEvent($this->getHandleType(), new Response($command, Response::SUCCESS)), + Event\Events::ON_DIRECT_RESPONSE ); return $result; } catch (\Exception $e) { $this->eventDispatcher->dispatch( - Event\Events::ON_DIRECT_RESPONSE, - new Event\OnDirectResponseEvent($this->getHandleType(), new Response($command, Response::FAILED, $e)) + new Event\OnDirectResponseEvent($this->getHandleType(), new Response($command, Response::FAILED, $e)), + Event\Events::ON_DIRECT_RESPONSE ); throw $e;