Skip to content

Commit

Permalink
[5.3] Fixed broken event interface listening (#16877)
Browse files Browse the repository at this point in the history
* Fixed broken event interface listening

* Fixed typos

* Use the correct variable
  • Loading branch information
GrahamCampbell authored and taylorotwell committed Dec 20, 2016
1 parent ec9a49d commit d744b01
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Illuminate/Events/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,16 @@ protected function sortListeners($eventName)
$listeners = isset($this->listeners[$eventName])
? $this->listeners[$eventName] : [];

if (class_exists($eventName, false)) {
if (class_exists($eventName)) {
foreach (class_implements($eventName) as $interface) {
if (isset($this->listeners[$interface])) {
$listeners = array_merge_recursive($listeners, $this->listeners[$interface]);
foreach ($this->listeners[$interface] as $priority => $names) {
if (isset($listeners[$priority])) {
$listeners[$priority] = array_merge($listeners[$priority], $names);
} else {
$listeners[$priority] = $names;
}
}
}
}
}
Expand Down

0 comments on commit d744b01

Please sign in to comment.