ImmutableEventDispatcher.php in Zircon Profile 8.0
File
vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php
View source
<?php
namespace Symfony\Component\EventDispatcher;
class ImmutableEventDispatcher implements EventDispatcherInterface {
private $dispatcher;
public function __construct(EventDispatcherInterface $dispatcher) {
$this->dispatcher = $dispatcher;
}
public function dispatch($eventName, Event $event = null) {
return $this->dispatcher
->dispatch($eventName, $event);
}
public function addListener($eventName, $listener, $priority = 0) {
throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
}
public function addSubscriber(EventSubscriberInterface $subscriber) {
throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
}
public function removeListener($eventName, $listener) {
throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
}
public function removeSubscriber(EventSubscriberInterface $subscriber) {
throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
}
public function getListeners($eventName = null) {
return $this->dispatcher
->getListeners($eventName);
}
public function hasListeners($eventName = null) {
return $this->dispatcher
->hasListeners($eventName);
}
}