8000 merged branch drak/eventsubscribersnotice (PR #3902) · kimhemsoe/symfony@b2af6b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit b2af6b4

Browse files
committed
merged branch drak/eventsubscribersnotice (PR symfony#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.
2 parents 5a320ca + e199049 commit b2af6b4

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