[EventDispatcher] simplified code (thanks Kris Wallsmith for the tip)

This commit is contained in:
Fabien Potencier 2011-02-04 00:29:28 +01:00
parent b01805a5c4
commit 93fc26d869

View File

@ -140,13 +140,8 @@ class EventDispatcher implements EventDispatcherInterface
return array();
}
$listeners = array();
$all = $this->listeners[$name];
krsort($all);
foreach ($all as $l) {
$listeners = array_merge($listeners, $l);
}
krsort($this->listeners[$name]);
return $listeners;
return call_user_func_array('array_merge', $this->listeners[$name]);
}
}