diff --git a/src/Symfony/Bundle/FrameworkBundle/ContainerAwareEventDispatcher.php b/src/Symfony/Bundle/FrameworkBundle/ContainerAwareEventDispatcher.php index 539f908f49..b0cfe53a59 100644 --- a/src/Symfony/Bundle/FrameworkBundle/ContainerAwareEventDispatcher.php +++ b/src/Symfony/Bundle/FrameworkBundle/ContainerAwareEventDispatcher.php @@ -49,20 +49,19 @@ class ContainerAwareEventDispatcher extends EventDispatcher /** * Adds a service as event listener * - * @param string|array $events One or more events for which the listener - * is added - * @param string $serviceId The ID of the listener service - * @param integer $priority The higher this value, the earlier an event - * listener will be triggered in the chain. - * Defaults to 0. + * @param string|array $eventNames One or more events for which the listener is added + * @param string $serviceId The ID of the listener service + * @param integer $priority The higher this value, the earlier an event listener + * will be triggered in the chain. + * Defaults to 0. */ - public function addListenerService($events, $serviceId, $priority = 0) + public function addListenerService($eventNames, $serviceId, $priority = 0) { if (!is_string($serviceId)) { throw new \InvalidArgumentException('Expected a string argument'); } - foreach ((array) $events as $event) { + foreach ((array) $eventNames as $event) { // Prevent duplicate entries $this->listenerIds[$event][$serviceId] = $priority; } diff --git a/src/Symfony/Bundle/FrameworkBundle/Debug/TraceableEventDispatcher.php b/src/Symfony/Bundle/FrameworkBundle/Debug/TraceableEventDispatcher.php index 1db3b4e363..2ded4bb860 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Debug/TraceableEventDispatcher.php +++ b/src/Symfony/Bundle/FrameworkBundle/Debug/TraceableEventDispatcher.php @@ -154,7 +154,15 @@ class TraceableEventDispatcher extends ContainerAwareEventDispatcher implements return $notCalled; } - protected function getListenerInfo($listener, $eventName) + /** + * Returns information about the listener + * + * @param object $listener The listener + * @param string $eventName The event name + * + * @return array Informations about the listener + */ + private function getListenerInfo($listener, $eventName) { $info = array('event' => $eventName); if ($listener instanceof \Closure) { diff --git a/src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php b/src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php index 9ad999c3cf..edd9081c55 100644 --- a/src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php +++ b/src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php @@ -37,9 +37,9 @@ namespace Symfony\Component\EventDispatcher; interface EventSubscriberInterface { /** - * Returns an array of events this subscriber wants to listen to. + * Returns an array of event names this subscriber wants to listen to. * - * @return array + * @return array The event names to listen to */ static function getSubscribedEvents(); }