/**
* @inheritdoc
*/
public function addSubscriber(EventSubscriberInterface $subscriber)
{
// This is what the actual Symfony Event Dispatcher does. Replicate it to remove the dependency on its interface.
foreach ($subscriber->getSubscribedEvents() as $eventName => $params) {
if (is_string($params)) {
$this->dispatcher->addListener($eventName, array($subscriber, $params));
} elseif (is_string($params[0])) {
$this->dispatcher->addListener($eventName, array($subscriber, $params[0]), isset($params[1]) ? $params[1] : 0);
} else {
foreach ($params as $listener) {
$this->dispatcher->addListener($eventName, array($subscriber, $listener[0]), isset($listener[1]) ? $listener[1] : 0);
}
}
}
}