[Event] Tweak phpDoc for consistency
This commit is contained in:
parent
a6c3b4bfa2
commit
745d144e79
@ -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|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.
|
||||
* @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;
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user