public function ImmutableEventDispatcher::addListener

Adds an event listener that listens on the specified events.

@api

Parameters

string $eventName The event to listen on:

callable $listener The listener:

integer $priority The higher this value, the earlier an event: listener will be triggered in the chain (defaults to 0)

Overrides EventDispatcherInterface::addListener

File

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

Class

ImmutableEventDispatcher
A read-only proxy for an event dispatcher.

Namespace

Symfony\Component\EventDispatcher

Code

public function addListener($eventName, $listener, $priority = 0) {
  throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
}