diff --git a/src/Illuminate/Events/Dispatcher.php b/src/Illuminate/Events/Dispatcher.php index 27dcfbfbf12b..be3561b5c0e4 100755 --- a/src/Illuminate/Events/Dispatcher.php +++ b/src/Illuminate/Events/Dispatcher.php @@ -37,7 +37,7 @@ class Dispatcher implements DispatcherContract protected $wildcards = []; /** - * Wildcard listeners cache which saves expensive string operations. + * The cached wildcard listeners. * * @var array */ @@ -290,9 +290,10 @@ public function getListeners($eventName) { $listeners = $this->listeners[$eventName] ?? []; - $wildcardListeners = $this->wildcardsCache[$eventName] ?? $this->getWildcardListeners($eventName); - - $listeners = array_merge($listeners, $wildcardListeners); + $listeners = array_merge( + $listeners, + $this->wildcardsCache[$eventName] ?? $this->getWildcardListeners($eventName) + ); return class_exists($eventName, false) ? $this->addInterfaceListeners($eventName, $listeners)