Browse Source

[Event] Tweak phpDoc for consistency

Victor Berchet 14 years ago
parent
commit
745d144e79

+ 7 - 8
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;
         }

+ 9 - 1
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) {

+ 2 - 2
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();
 }