Skip to content

Commit

Permalink
[EventDispatcher] Fixed E_NOTICES with multiple eventnames per subscr…
Browse files Browse the repository at this point in the history
…iber with mixed priorities
  • Loading branch information
Drak committed Apr 12, 2012
1 parent 8835357 commit 57dd914
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Component/EventDispatcher/EventDispatcher.php
Expand Up @@ -117,7 +117,7 @@ public function addSubscriber(EventSubscriberInterface $subscriber)
if (is_string($params)) {
$this->addListener($eventName, array($subscriber, $params));
} else {
$this->addListener($eventName, array($subscriber, $params[0]), $params[1]);
$this->addListener($eventName, array($subscriber, $params[0]), isset($params[1]) ? $params[1] : 0);
}
}
}
Expand Down
Expand Up @@ -241,6 +241,9 @@ class TestEventSubscriberWithPriorities implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return array('pre.foo' => array('preFoo', 10));
return array(
'pre.foo' => array('preFoo', 10),
'post.foo' => array('postFoo'),
);
}
}

0 comments on commit 57dd914

Please sign in to comment.