merged branch drak/eventsubscriber_notice (PR #3900)
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.
This commit is contained in:
commit
3bd2e01ea7
@ -117,7 +117,7 @@ class EventDispatcher implements EventDispatcherInterface
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user