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