Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/EventManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,19 +447,15 @@ protected function triggerListeners($event, EventInterface $e, $callback = null)
$wildcardListeners = $this->getListeners('*');
if (count($sharedListeners) || count($sharedWildcardListeners) || count($wildcardListeners)) {
$listeners = clone $listeners;
}

// Shared listeners on this specific event
$this->insertListeners($listeners, $sharedListeners);

// Shared wildcard listeners
$this->insertListeners($listeners, $sharedWildcardListeners);
// Shared listeners on this specific event
$this->insertListeners($listeners, $sharedListeners);

// Add wildcard listeners
$this->insertListeners($listeners, $wildcardListeners);
// Shared wildcard listeners
$this->insertListeners($listeners, $sharedWildcardListeners);

if ($listeners->isEmpty()) {
return $responses;
// Add wildcard listeners
$this->insertListeners($listeners, $wildcardListeners);
}

foreach ($listeners as $listener) {
Expand Down Expand Up @@ -535,10 +531,6 @@ protected function getSharedListeners($event)
*/
protected function insertListeners($masterListeners, $listeners)
{
if (!count($listeners)) {
return;
}

foreach ($listeners as $listener) {
$priority = $listener->getMetadatum('priority');
if (null === $priority) {
Expand Down

0 comments on commit 035474f

Please sign in to comment.