Open Journal Systems  3.3.0
vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php
1 <?php
2 
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
13 
19 class ImmutableEventDispatcher implements EventDispatcherInterface
20 {
21  private $dispatcher;
22 
23  public function __construct(EventDispatcherInterface $dispatcher)
24  {
25  $this->dispatcher = $dispatcher;
26  }
27 
31  public function dispatch($eventName, Event $event = null)
32  {
33  return $this->dispatcher->dispatch($eventName, $event);
34  }
35 
39  public function addListener($eventName, $listener, $priority = 0)
40  {
41  throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
42  }
43 
47  public function addSubscriber(EventSubscriberInterface $subscriber)
48  {
49  throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
50  }
51 
55  public function removeListener($eventName, $listener)
56  {
57  throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
58  }
59 
63  public function removeSubscriber(EventSubscriberInterface $subscriber)
64  {
65  throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
66  }
67 
71  public function getListeners($eventName = null)
72  {
73  return $this->dispatcher->getListeners($eventName);
74  }
75 
79  public function getListenerPriority($eventName, $listener)
80  {
81  return $this->dispatcher->getListenerPriority($eventName, $listener);
82  }
83 
87  public function hasListeners($eventName = null)
88  {
89  return $this->dispatcher->hasListeners($eventName);
90  }
91 }
Symfony\Component\EventDispatcher\ImmutableEventDispatcher\removeListener
removeListener($eventName, $listener)
Definition: vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php:55
Symfony\Component\EventDispatcher\ImmutableEventDispatcher\hasListeners
hasListeners($eventName=null)
Definition: vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php:87
Symfony\Component\EventDispatcher\EventSubscriberInterface
Definition: lib/vendor/symfony/event-dispatcher/EventSubscriberInterface.php:25
Symfony\Component\EventDispatcher\ImmutableEventDispatcher\addListener
addListener($eventName, $listener, $priority=0)
Definition: vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php:39
Symfony\Component\EventDispatcher\ImmutableEventDispatcher\getListeners
getListeners($eventName=null)
Definition: vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php:71
Symfony\Component\EventDispatcher
Definition: lib/vendor/symfony/event-dispatcher/ContainerAwareEventDispatcher.php:12
Symfony\Component\EventDispatcher\ImmutableEventDispatcher\dispatch
dispatch($eventName, Event $event=null)
Definition: vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php:31
Symfony\Component\EventDispatcher\ImmutableEventDispatcher\removeSubscriber
removeSubscriber(EventSubscriberInterface $subscriber)
Definition: vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php:63
Symfony\Component\EventDispatcher\ImmutableEventDispatcher\addSubscriber
addSubscriber(EventSubscriberInterface $subscriber)
Definition: vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php:47
Symfony\Component\EventDispatcher\EventDispatcherInterface
Definition: lib/vendor/symfony/event-dispatcher/EventDispatcherInterface.php:21
Symfony\Component\EventDispatcher\Event
Definition: lib/vendor/symfony/event-dispatcher/Event.php:28
Symfony\Component\EventDispatcher\ImmutableEventDispatcher\__construct
__construct(EventDispatcherInterface $dispatcher)
Definition: vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php:23
Symfony\Component\EventDispatcher\ImmutableEventDispatcher\getListenerPriority
getListenerPriority($eventName, $listener)
Definition: vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php:79