Skip to content

Commit

Permalink
Global event listener bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
phpmathan committed Jun 30, 2020
1 parent 65f7a28 commit f028ba9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/event/src/Manager/EventManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ public function trigger($event, $target = null, array $args = []): EventInterfac
$shouldCall[$name] = '';
}

// Have global wildcards '*' listener.
if (isset($this->listenedEvents['*'])) {
$shouldCall['*'] = '';
}

// Like 'app.db.query' => prefix: 'app.db'
if ($pos = strrpos($name, '.')) {
$prefix = substr($name, 0, $pos);
Expand Down Expand Up @@ -339,12 +344,7 @@ public function trigger($event, $target = null, array $args = []): EventInterfac
}
}

// Have global wildcards '*' listener.
if (isset($this->listenedEvents['*'])) {
$this->triggerListeners($this->listeners['*'], $event);
}

return $this->destroyAfterFire ? $event->destroy() : $event;
return $event;
}

/**
Expand Down

0 comments on commit f028ba9

Please sign in to comment.