Skip to content

Commit

Permalink
make sure callback is called
Browse files Browse the repository at this point in the history
  • Loading branch information
bakura10 committed May 15, 2014
1 parent 1083e75 commit 01b2975
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/Zend/EventManager/EventManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function trigger($eventName, EventInterface $event = null, callable $call
$lastResponse = $listener($event);
$responses[] = $lastResponse;

if ($event->isPropagationStopped() || ($callback && $callback($lastResponse))) {
if (($callback && $callback($lastResponse) || $event->isPropagationStopped())) {
$responseCollection = new ResponseCollection($responses);
$responseCollection->setStopped(true);

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/EventManager/FastEventManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function trigger($eventName, EventInterface $event = null, callable $call
$lastResponse = $listener($event);
$responses[] = $lastResponse;

if ($event->isPropagationStopped() || ($callback && $callback($lastResponse))) {
if (($callback && $callback($lastResponse) || $event->isPropagationStopped())) {
$responseCollection = new ResponseCollection($responses);
$responseCollection->setStopped(true);

Expand Down

0 comments on commit 01b2975

Please sign in to comment.