Skip to content

Commit

Permalink
[EventDispatcher] added a way to disconnect all listeners for an even…
Browse files Browse the repository at this point in the history
…t name
  • Loading branch information
fabpot committed Sep 1, 2010
1 parent ebae1d7 commit 2d04ca3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Symfony/Component/EventDispatcher/EventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public function connect($name, $listener, $priority = 0)
/**
* Disconnects a listener for a given event name.
*
* @param string $name An event name
* @param mixed $listener A PHP callable
* @param string $name An event name
* @param mixed|null $listener A PHP callable or null to disconnect all listeners
*
* @return mixed false if listener does not exist, null otherwise
*/
public function disconnect($name, $listener)
public function disconnect($name, $listener = null)
{
if (!isset($this->listeners[$name])) {
return false;
Expand Down

0 comments on commit 2d04ca3

Please sign in to comment.