src/Event/EventManager.php
public function addSubscriber(EventSubscriberInterface $subscriber)
	{
		foreach ($subscriber->getSubscribedEvents() as $eventName => $params) {
			if (\is_string($params)) {
				$this->attach($eventName, [$subscriber, $params]);
			} elseif (\is_array($params)) {
				if (\is_string($params[0])) {
					$this->attach($eventName, [$subscriber, $params[0]], $params[1] ?? 0);
				} else {
					foreach ($params as $listener) {
						$this->attach($eventName, [$subscriber, $listener[0]], $listener[1] ?? 0);
					}
				}
			}
		}

		return $this;
	}
public function addSubscriber(EventSubscriberInterface $subscriber)
	{
		foreach ($subscriber->getSubscribedEvents() as $eventName => $params) {
			if (\is_string($params)) {
				$this->attach($eventName, [$subscriber, $params]);
			} elseif (\is_array($params)) {
				if (\is_string($params[0])) {
					$this->attach($eventName, [$subscriber, $params[0]], $params[1] ?? 0);
				} else {
					foreach ($params as $listener) {
						$this->attach($eventName, [$subscriber, $listener[0]], $listener[1] ?? 0);
					}
				}
			}
		}

		return $this;
	}
public function addSubscriber ( EventSubscriberInterface $ subscriber ) { foreach ( $ subscriber -> getSubscribedEvents ( ) as $ eventName => $ params ) { if ( \ is_string ( $ params ) ) { $ this -> attach ( $ eventName , [ $ subscriber , $ params ] ) ; } elseif ( \ is_array ( $ params ) ) { if ( \ is_string ( $ params [ 0 ] ) ) { $ this -> attach ( $ eventName , [ $ subscriber , $ params [ 0 ] ] , $ params [ 1 ] ?? 0 ) ; } else { foreach ( $ params as $ listener ) { $ this -> attach ( $ eventName , [ $ subscriber , $ listener [ 0 ] ] , $ listener [ 1 ] ?? 0 ) ; } } } } return $ this ; }
Adds an event subscriber.

The subscriber is asked for all the events he is
interested in and added as a listener for these events.

@param EventSubscriberInterface $subscriber The subscriber

@return $this
Adds an event subscriber .