Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

… E_NOTICES
  • Loading branch information...
commit e199049581dbd8b4d84bee39d85ef145b1d3668d 1 parent 5a320ca
Drak drak authored
2  src/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php
@@ -141,7 +141,7 @@ public function addSubscriberService($serviceId, $class)
141 141 if (is_string($params)) {
142 142 $this->listenerIds[$eventName][] = array($serviceId, $params, 0);
143 143 } 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);
145 145 } else {
146 146 foreach ($params as $listener) {
147 147 $this->listenerIds[$eventName][] = array($serviceId, $listener[0], isset($listener[1]) ? $listener[1] : 0);
2  src/Symfony/Component/EventDispatcher/Tests/ContainerAwareEventDispatcherTest.php
@@ -245,6 +245,8 @@ class SubscriberService implements EventSubscriberInterface
245 245 static function getSubscribedEvents() {
246 246 return array(
247 247 'onEvent' => 'onEvent',
  248 + 'onEvent' => array('onEvent', 10),
  249 + 'onEvent' => array('onEvent'),
248 250 );
249 251 }
250 252

0 comments on commit e199049

Please sign in to comment.
Something went wrong with that request. Please try again.