[Event] Tweak phpDoc for consistency

This commit is contained in:
Victor Berchet 2011-04-06 09:31:06 +02:00
parent a6c3b4bfa2
commit 745d144e79
3 changed files with 18 additions and 11 deletions

View File

@ -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;
}

View File

@ -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) {

View File

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