public function ImmutableEventDispatcher::addSubscriber

Adds an event subscriber.

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

@api

Parameters

EventSubscriberInterface $subscriber The subscriber.:

Overrides EventDispatcherInterface::addSubscriber

File

drupal/core/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php, line 56

Class

ImmutableEventDispatcher
A read-only proxy for an event dispatcher.

Namespace

Symfony\Component\EventDispatcher

Code

public function addSubscriber(EventSubscriberInterface $subscriber) {
  throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
}