8000 merged branch drak/eventsubscriber_notice (PR #3900) · phreaknerd/symfony@3bd2e01 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3bd2e01

Browse files
committed
merged branch drak/eventsubscriber_notice (PR symfony#3900)
Commits ------- 57dd914 [EventDispatcher] Fixed E_NOTICES with multiple eventnames per subscriber with mixed priorities Discussion ---------- [EventDispatcher] Fixed E_NOTICES with multiple eventnames per subscriber Bug fix: yes Feature addition: no Backwards compatibility break: no Symfony2 tests pass: yes Fixes the following tickets: - Todo: - This fixes a case that was not covered by the existing tests.
2 parents 8835357 + 57dd914 commit 3bd2e01

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Symfony/Component/EventDispatcher/EventDispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function addSubscriber(EventSubscriberInterface $subscriber)
117117
if (is_string($params)) {
118118
$this->addListener($eventName, array($subscriber, $params));
119119
} else {
120-
$this->addListener($eventName, array($subscriber, $params[0]), $params[1]);
120+
$this->addListener($eventName, array($subscriber, $params[0]), isset($params[1]) ? $params[1] : 0);
121121
}
122122
}
123123
}

tests/Symfony/Tests/Component/EventDispatcher/EventDispatcherTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ class TestEventSubscriberWithPriorities implements EventSubscriberInterface
241241
{
242242
public static function getSubscribedEvents()
243243
{
244-
return array('pre.foo' => array('preFoo', 10));
244+
return array(
245+
'pre.foo' => array('preFoo', 10),
246+
'post.foo' => array('postFoo'),
247+
);
245248
}
246249
}

0 commit comments

Comments
 (0)
0