merged branch drak/eventsubscribersnotice (PR #3902)
Commits
-------
e199049
[EventDispatcher] Fixed edge case not covered by tests that generated E_NOTICES
Discussion
----------
[EventDispatcher] Fixed edge case not covered by tests.
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
Fixes case not covered by tests.
This commit is contained in:
commit
b2af6b4f24
@ -141,7 +141,7 @@ class ContainerAwareEventDispatcher extends EventDispatcher
|
|||||||
if (is_string($params)) {
|
if (is_string($params)) {
|
||||||
$this->listenerIds[$eventName][] = array($serviceId, $params, 0);
|
$this->listenerIds[$eventName][] = array($serviceId, $params, 0);
|
||||||
} elseif (is_string($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 {
|
} else {
|
||||||
foreach ($params as $listener) {
|
foreach ($params as $listener) {
|
||||||
$this->listenerIds[$eventName][] = array($serviceId, $listener[0], isset($listener[1]) ? $listener[1] : 0);
|
$this->listenerIds[$eventName][] = array($serviceId, $listener[0], isset($listener[1]) ? $listener[1] : 0);
|
||||||
|
@ -245,6 +245,8 @@ class SubscriberService implements EventSubscriberInterface
|
|||||||
static function getSubscribedEvents() {
|
static function getSubscribedEvents() {
|
||||||
return array(
|
return array(
|
||||||
'onEvent' => 'onEvent',
|
'onEvent' => 'onEvent',
|
||||||
|
'onEvent' => array('onEvent', 10),
|
||||||
|
'onEvent' => array('onEvent'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user