Skip to content

Commit

Permalink
merged branch drak/eventsubscriber_notice (PR #3900)
Browse files Browse the repository at this point in the history
Commits
-------

57dd914 [EventDispatcher] Fixed E_NOTICES with multiple eventnames per subscriber with mixed priorities

Discussion
----------

[EventDispatcher] Fixed E_NOTICES with multiple eventnames per subscriber

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

This fixes a case that was not covered by the existing tests.
  • Loading branch information
fabpot committed Apr 12, 2012
2 parents c2aa255 + 0f40d22 commit 3e410b8
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 3e410b8

Please sign in to comment.