From 906692cd049b9c372e91f9433337962a5253b260 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 29 Mar 2022 21:58:53 +0200 Subject: [PATCH] Allow null eventName in EventDispatcher::dispatch --- src/Composer/EventDispatcher/EventDispatcher.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Composer/EventDispatcher/EventDispatcher.php b/src/Composer/EventDispatcher/EventDispatcher.php index 73b8c58f2..b57e577d8 100644 --- a/src/Composer/EventDispatcher/EventDispatcher.php +++ b/src/Composer/EventDispatcher/EventDispatcher.php @@ -91,12 +91,12 @@ class EventDispatcher /** * Dispatch an event * - * @param string $eventName An event name - * @param Event $event - * @return int return code of the executed script if any, for php scripts a false return + * @param string|null $eventName An event name if no $event is provided + * @param Event $event + * @return int return code of the executed script if any, for php scripts a false return * value is changed to 1, anything else to 0 */ - public function dispatch(string $eventName, Event $event = null): int + public function dispatch(?string $eventName, Event $event = null): int { if (null === $event) { $event = new Event($eventName);