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

Commit

Permalink
Merge branch 'develop' of https://github.com/wilmoore/zf2 into hotfix…
Browse files Browse the repository at this point in the history
…/event_manager-priority_queue_api
  • Loading branch information
weierophinney committed Mar 17, 2011
2 parents dc83fe5 + 73b9365 commit 4235f98
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/Zend/EventManager/EventManager.php
Expand Up @@ -154,12 +154,13 @@ public function triggerUntil($event, $context, $argv, $callback)

$responses = new ResponseCollection;
$e = new $this->eventClass($event, $context, $argv);
$handlers = $this->getHandlers($event);

if (empty($this->events[$event])) {
if ($handlers->isEmpty()) {
return $this->triggerStaticHandlers($callback, $e, $responses);
}

foreach ($this->events[$event] as $handler) {
foreach ($handlers as $handler) {
$responses->push(call_user_func($handler->getCallback(), $e));
if ($e->propagationIsStopped()) {
$responses->setStopped(true);
Expand All @@ -170,6 +171,7 @@ public function triggerUntil($event, $context, $argv, $callback)
break;
}
}

if (!$responses->stopped()) {
$this->triggerStaticHandlers($callback, $e, $responses);
}
Expand Down

0 comments on commit 4235f98

Please sign in to comment.