10000 [EventDispatcher] Fixed edge case not covered by tests that generated… · hostingnuggets/symfony@e199049 · GitHub
[go: up one dir, main page]

Skip to content

Commit e199049

Browse files
author
Drak
committed
[EventDispatcher] Fixed edge case not covered by tests that generated E_NOTICES
1 parent 5a320ca commit e199049

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function addSubscriberService($serviceId, $class)
141141
if (is_string($params)) {
142142
$this->listenerIds[$eventName][] = array($serviceId, $params, 0);
143143
} elseif (is_string($params[0])) {
144-
$this->listenerIds[$eventName][] = array($serviceId, $params[0], $params[1]);
144+
$this->listenerIds[$eventName][] = array($serviceId, $params[0], isset($params[1]) ? $params[1] : 0);
145145
} else {
146146
foreach ($params as $listener) {
147147
$this->listenerIds[$eventName][] = array($serviceId, $listener[0], isset($listener[1]) ? $listener[1] : 0);

src/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ class SubscriberService implements EventSubscriberInterface
245245
static function getSubscribedEvents() {
246246
return array(
247247
'onEvent' => 'onEvent',
248+
'onEvent' => array('onEvent', 10),
249+
'onEvent' => array('onEvent'),
248250
);
249251
}
250252

0 commit comments

Comments
 (0)
0