Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[EventDispatcher] Fixed E_NOTICES with multiple eventnames per subscriber #3900

Merged
merged 1 commit into from

3 participants

Drak Igor Fabien Potencier
Drak

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.

Fabien Potencier fabpot referenced this pull request from a commit
Fabien Potencier fabpot merged branch drak/eventsubscriber_notice (PR #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.
3bd2e01
Fabien Potencier fabpot merged commit 57dd914 into from
Igor igorw commented on the diff
...sts/Component/EventDispatcher/EventDispatcherTest.php
@@ -241,6 +241,9 @@ class TestEventSubscriberWithPriorities implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
- return array('pre.foo' => array('preFoo', 10));
+ return array(
+ 'pre.foo' => array('preFoo', 10),
+ 'post.foo' => array('postFoo'),
+ );
Igor
igorw added a note

CS: this should probably be unindented.

Drak
drak added a note

Done for readability.

Igor
igorw added a note

Sorry, I meant:

return array(
    'pre.foo' => array('preFoo', 10),
    'post.foo' => array('postFoo'),
);
Drak
drak added a note

Yes :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
mmucklo mmucklo referenced this pull request from a commit
Fabien Potencier fabpot merged branch drak/eventsubscriber_notice (PR #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.
3e410b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 12, 2012
  1. Drak

    [EventDispatcher] Fixed E_NOTICES with multiple eventnames per subscr…

    drak authored
    …iber with mixed priorities
This page is out of date. Refresh to see the latest.
2  src/Symfony/Component/EventDispatcher/EventDispatcher.php
View
@@ -117,7 +117,7 @@ public function addSubscriber(EventSubscriberInterface $subscriber)
if (is_string($params)) {
$this->addListener($eventName, array($subscriber, $params));
} else {
- $this->addListener($eventName, array($subscriber, $params[0]), $params[1]);
+ $this->addListener($eventName, array($subscriber, $params[0]), isset($params[1]) ? $params[1] : 0);
}
}
}
5 tests/Symfony/Tests/Component/EventDispatcher/EventDispatcherTest.php
View
@@ -241,6 +241,9 @@ class TestEventSubscriberWithPriorities implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
- return array('pre.foo' => array('preFoo', 10));
+ return array(
+ 'pre.foo' => array('preFoo', 10),
+ 'post.foo' => array('postFoo'),
+ );
Igor
igorw added a note

CS: this should probably be unindented.

Drak
drak added a note

Done for readability.

Igor
igorw added a note

Sorry, I meant:

return array(
    'pre.foo' => array('preFoo', 10),
    'post.foo' => array('postFoo'),
);
Drak
drak added a note

Yes :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
}
}
Something went wrong with that request. Please try again.