You are here

public function ImmutableEventDispatcher::addSubscriber in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php \Symfony\Component\EventDispatcher\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.

Parameters

EventSubscriberInterface $subscriber The subscriber.:

Overrides EventDispatcherInterface::addSubscriber

File

vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php, line 57

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.');
}