diff --git a/src/Events/NotificationHandler/SentNotificationResponseEvent.php b/src/Events/NotificationHandler/SentResponseEvent.php similarity index 71% rename from src/Events/NotificationHandler/SentNotificationResponseEvent.php rename to src/Events/NotificationHandler/SentResponseEvent.php index 19b57d0..5dbb4bd 100644 --- a/src/Events/NotificationHandler/SentNotificationResponseEvent.php +++ b/src/Events/NotificationHandler/SentResponseEvent.php @@ -5,13 +5,13 @@ use Symfony\Component\EventDispatcher\Event; /** - * Class SentNotificationResponseEvent + * Class SentResponseEvent * * @package EC\Poetry\Events\NotificationHandler */ -class SentNotificationResponseEvent extends Event +class SentResponseEvent extends Event { - const NAME = 'poetry.notification_handler.sent_notification_response'; + const NAME = 'poetry.notification_handler.sent_response'; /** * @var string @@ -19,7 +19,7 @@ class SentNotificationResponseEvent extends Event private $message; /** - * SentNotificationResponseEvent constructor. + * SentResponseEvent constructor. * * @param string $message */ diff --git a/src/NotificationHandler.php b/src/NotificationHandler.php index a2cb263..6a8daef 100644 --- a/src/NotificationHandler.php +++ b/src/NotificationHandler.php @@ -3,7 +3,7 @@ namespace EC\Poetry; use EC\Poetry\Events\NotificationHandler\ReceivedNotificationEvent; -use EC\Poetry\Events\NotificationHandler\SentNotificationResponseEvent; +use EC\Poetry\Events\NotificationHandler\SentResponseEvent; use EC\Poetry\Events\ParseNotificationEvent; use EC\Poetry\Exceptions\Notifications\CannotAuthenticateException; use EC\Poetry\Exceptions\ParsingException; @@ -87,8 +87,8 @@ public function handle($username, $password, $xml) $response = $this->getErrorStatus($exception->getMessage(), $event->getMessage()); } finally { - $event = new SentNotificationResponseEvent($response); - $this->eventDispatcher->dispatch(SentNotificationResponseEvent::NAME, $event); + $event = new SentResponseEvent($response); + $this->eventDispatcher->dispatch(SentResponseEvent::NAME, $event); return $response; } diff --git a/src/Services/LoggerSubscriber.php b/src/Services/LoggerSubscriber.php index a2da6c0..ccb5cc4 100644 --- a/src/Services/LoggerSubscriber.php +++ b/src/Services/LoggerSubscriber.php @@ -7,7 +7,7 @@ use EC\Poetry\Events\ExceptionEvent; use EC\Poetry\Events\NotificationEventInterface; use EC\Poetry\Events\NotificationHandler\ReceivedNotificationEvent; -use EC\Poetry\Events\NotificationHandler\SentNotificationResponseEvent; +use EC\Poetry\Events\NotificationHandler\SentResponseEvent; use EC\Poetry\Events\Notifications\StatusUpdatedEvent; use EC\Poetry\Events\Notifications\TranslationReceivedEvent; use EC\Poetry\Events\ParseNotificationEvent; @@ -65,7 +65,7 @@ public static function getSubscribedEvents() ClientRequestEvent::NAME => 'onClientRequestEvent', ClientResponseEvent::NAME => 'onClientResponseEvent', ReceivedNotificationEvent::NAME => 'onReceivedNotificationEvent', - SentNotificationResponseEvent::NAME => 'onSentNotificationResponseEvent', + SentResponseEvent::NAME => 'onSentNotificationResponseEvent', ExceptionEvent::NAME => 'onExceptionEvent', ]; } @@ -120,11 +120,11 @@ public function onReceivedNotificationEvent(ReceivedNotificationEvent $event) } /** - * @param \EC\Poetry\Events\NotificationHandler\SentNotificationResponseEvent $event + * @param \EC\Poetry\Events\NotificationHandler\SentResponseEvent $event */ - public function onSentNotificationResponseEvent(SentNotificationResponseEvent $event) + public function onSentNotificationResponseEvent(SentResponseEvent $event) { - $this->logInfo(SentNotificationResponseEvent::NAME, ['message' => $event->getMessage()]); + $this->logInfo(SentResponseEvent::NAME, ['message' => $event->getMessage()]); } /** diff --git a/tests/src/NotificationHandlerTest.php b/tests/src/NotificationHandlerTest.php index f7a5b9f..adedb6a 100644 --- a/tests/src/NotificationHandlerTest.php +++ b/tests/src/NotificationHandlerTest.php @@ -158,7 +158,7 @@ public function loggingCycleDataProvider() 'poetry.notification_handler.received_notification', 'poetry.notification.parse', 'poetry.notification.status_updated', - 'poetry.notification_handler.sent_notification_response', + 'poetry.notification_handler.sent_response', ], ], [ @@ -166,7 +166,7 @@ public function loggingCycleDataProvider() [ 'poetry.notification_handler.received_notification', 'poetry.notification.status_updated', - 'poetry.notification_handler.sent_notification_response', + 'poetry.notification_handler.sent_response', ], ], ];