Permalink
Browse files

merged 2.0

  • Loading branch information...
2 parents 68d2bb6 + 69f86e4 commit 085ec3b33547515749c87a9c4039dc6a842d61d9 @fabpot fabpot committed Apr 12, 2012
Showing with 5 additions and 2 deletions.
  1. +1 −1 EventDispatcher.php
  2. +4 −1 Tests/EventDispatcherTest.php
View
@@ -123,7 +123,7 @@ public function addSubscriber(EventSubscriberInterface $subscriber)
if (is_string($params)) {
$this->addListener($eventName, array($subscriber, $params));
} elseif (is_string($params[0])) {
- $this->addListener($eventName, array($subscriber, $params[0]), $params[1]);
+ $this->addListener($eventName, array($subscriber, $params[0]), isset($params[1]) ? $params[1] : 0);
} else {
foreach ($params as $listener) {
$this->addListener($eventName, array($subscriber, $listener[0]), isset($listener[1]) ? $listener[1] : 0);
@@ -278,7 +278,10 @@ 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'),
+ );
}
}

0 comments on commit 085ec3b

Please sign in to comment.