diff --git a/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php b/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php index 0cf5669543cd88fa5c606b64d83608b1aff643c6..8aa35299beeaac68fd8dd609a47778377f31f663 100644 --- a/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php +++ b/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php @@ -153,7 +153,7 @@ public function dispatch($event/*, string $event_name = NULL*/) { /** * {@inheritdoc} */ - public function getListeners($event_name = NULL) { + public function getListeners($event_name = NULL): array { $result = []; if ($event_name === NULL) { @@ -193,9 +193,9 @@ public function getListeners($event_name = NULL) { /** * {@inheritdoc} */ - public function getListenerPriority($event_name, $listener) { + public function getListenerPriority($event_name, $listener): ?int { if (!isset($this->listeners[$event_name])) { - return; + return NULL; } if (is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure) { $listener[0] = $listener[0](); @@ -219,12 +219,13 @@ public function getListenerPriority($event_name, $listener) { } } } + return NULL; } /** * {@inheritdoc} */ - public function hasListeners($event_name = NULL) { + public function hasListeners($event_name = NULL): bool { if ($event_name !== NULL) { return !empty($this->listeners[$event_name]); }