[EventDispatcher] Fixed E_NOTICES with multiple eventnames per subscriber with mixed priorities
This commit is contained in:
parent
88353575e4
commit
57dd9147d9
@ -117,7 +117,7 @@ class EventDispatcher implements EventDispatcherInterface
|
|||||||
if (is_string($params)) {
|
if (is_string($params)) {
|
||||||
$this->addListener($eventName, array($subscriber, $params));
|
$this->addListener($eventName, array($subscriber, $params));
|
||||||
} else {
|
} 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()
|
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