Skip to content

Commit

Permalink
[EventDispatcher] Fix removeSubscriber() to work with priority syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikola committed Aug 23, 2011
1 parent 57f10d2 commit 296b16a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions EventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ public function addSubscriber(EventSubscriberInterface $subscriber)
*/
public function removeSubscriber(EventSubscriberInterface $subscriber)
{
foreach ($subscriber->getSubscribedEvents() as $eventName => $method) {
$this->removeListener($eventName, array($subscriber, $method));
foreach ($subscriber->getSubscribedEvents() as $eventName => $params) {
$this->removeListener($eventName, array($subscriber, is_string($params) ? $params : $params[0]));
}
}

Expand Down

0 comments on commit 296b16a

Please sign in to comment.