Skip to content

Commit

Permalink
[zendframework#5432] Incorporate feedback
Browse files Browse the repository at this point in the history
- Simplify logic when introspecting callback
  • Loading branch information
weierophinney committed Nov 12, 2013
1 parent 9c5ba9b commit 8bf4310
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions library/Zend/Mvc/Controller/Plugin/Forward.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,19 +177,16 @@ protected function detachProblemListeners(SharedEvents $sharedEvents)
foreach ($events as $currentEvent) {
$currentCallback = $currentEvent->getCallback();

// Testing against object callbacks
if (!is_object($currentCallback)
|| !is_array($currentCallback)
|| !isset($currentCallback[0])
) {
continue;
}

// If we have an array, grab the object
if (is_array($currentCallback)) {
$currentCallback = $currentCallback[0];
}

// This routine is only valid for object callbacks
if (!is_object($currentCallback)) {
continue;
}

foreach ($classArray as $class) {
if (is_a($currentCallback, $class)) {
$sharedEvents->detach($id, $currentEvent);
Expand Down

0 comments on commit 8bf4310

Please sign in to comment.