Permalink
Browse files

[EventDispatcher] Fixed edge case not covered by tests that generated…

… E_NOTICES
  • Loading branch information...
1 parent 085ec3b commit 135cdab82b11d81ea2969b12e1598b9337f5205d Drak committed Apr 12, 2012
Showing with 3 additions and 1 deletion.
  1. +1 −1 ContainerAwareEventDispatcher.php
  2. +2 −0 Tests/ContainerAwareEventDispatcherTest.php
@@ -141,7 +141,7 @@ public function addSubscriberService($serviceId, $class)
if (is_string($params)) {
$this->listenerIds[$eventName][] = array($serviceId, $params, 0);
} elseif (is_string($params[0])) {
- $this->listenerIds[$eventName][] = array($serviceId, $params[0], $params[1]);
+ $this->listenerIds[$eventName][] = array($serviceId, $params[0], isset($params[1]) ? $params[1] : 0);
} else {
foreach ($params as $listener) {
$this->listenerIds[$eventName][] = array($serviceId, $listener[0], isset($listener[1]) ? $listener[1] : 0);
@@ -245,6 +245,8 @@ class SubscriberService implements EventSubscriberInterface
static function getSubscribedEvents() {
return array(
'onEvent' => 'onEvent',
+ 'onEvent' => array('onEvent', 10),
+ 'onEvent' => array('onEvent'),
);
}

0 comments on commit 135cdab

Please sign in to comment.