Skip to content

Commit

Permalink
changed priority meaning to be more intuitive
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jan 14, 2011
1 parent f6ec218 commit 794c1e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion EventDispatcher.php
Expand Up @@ -24,6 +24,8 @@ class EventDispatcher
/**
* Connects a listener to a given event name.
*
* Listeners with a higher priority are executed first.
*
* @param string $name An event name
* @param mixed $listener A PHP callable
* @param integer $priority The priority (between -10 and 10 -- defaults to 0)
Expand Down Expand Up @@ -148,7 +150,7 @@ public function getListeners($name)

$listeners = array();
$all = $this->listeners[$name];
ksort($all);
krsort($all);
foreach ($all as $l) {
$listeners = array_merge($listeners, $l);
}
Expand Down

0 comments on commit 794c1e8

Please sign in to comment.