[EventDispatcher] Fixed edge case not covered by tests that generated E_NOTICES
This commit is contained in:
parent
5a320ca7bd
commit
e199049581
@ -141,7 +141,7 @@ class ContainerAwareEventDispatcher extends EventDispatcher
|
||||
if (is_string($params)) {
|
||||
$this->listenerIds[$eventName][] = array($serviceId, $params, 0);
|
||||
} elseif (is_string($params[0])) {
|
||||
$this->listenerIds[$eventName][] = array($serviceId, $params[0], $params[1]);
|
||||
$this->listenerIds[$eventName][] = array($serviceId, $params[0], isset($params[1]) ? $params[1] : 0);
|
||||
} else {
|
||||
foreach ($params as $listener) {
|
||||
$this->listenerIds[$eventName][] = array($serviceId, $listener[0], isset($listener[1]) ? $listener[1] : 0);
|
||||
|
@ -245,6 +245,8 @@ class SubscriberService implements EventSubscriberInterface
|
||||
static function getSubscribedEvents() {
|
||||
return array(
|
||||
'onEvent' => 'onEvent',
|
||||
'onEvent' => array('onEvent', 10),
|
||||
'onEvent' => array('onEvent'),
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user