1 | <?php |
||
15 | class DelayEventDispatcher implements EventDispatcherInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | private $eligibleEventNames = array(); |
||
21 | |||
22 | /** |
||
23 | * @var EventDispatcherInterface |
||
24 | */ |
||
25 | private $dispatcher; |
||
26 | |||
27 | /** |
||
28 | * @param EventDispatcherInterface $dispatcher |
||
29 | * @param array $eligibleEventNames |
||
30 | */ |
||
31 | 1 | public function __construct(EventDispatcherInterface $dispatcher, array $eligibleEventNames) |
|
36 | |||
37 | /** |
||
38 | * {@inheritDoc} |
||
39 | */ |
||
40 | 1 | public function dispatch($eventName, Event $event = null) |
|
60 | |||
61 | /** |
||
62 | * {@inheritDoc} |
||
63 | */ |
||
64 | public function addListener($eventName, $listener, $priority = 0) |
||
68 | |||
69 | /** |
||
70 | * {@inheritDoc} |
||
71 | */ |
||
72 | public function addSubscriber(EventSubscriberInterface $subscriber) |
||
76 | |||
77 | /** |
||
78 | * {@inheritDoc} |
||
79 | */ |
||
80 | public function removeListener($eventName, $listener) |
||
84 | |||
85 | /** |
||
86 | * {@inheritDoc} |
||
87 | */ |
||
88 | public function removeSubscriber(EventSubscriberInterface $subscriber) |
||
92 | |||
93 | /** |
||
94 | * {@inheritDoc} |
||
95 | */ |
||
96 | public function getListeners($eventName = null) |
||
100 | |||
101 | /** |
||
102 | * {@inheritDoc} |
||
103 | */ |
||
104 | public function hasListeners($eventName = null) |
||
108 | |||
109 | /** |
||
110 | * Proxies all method calls to the original event dispatcher. |
||
111 | * |
||
112 | * @param string $method The method name |
||
113 | * @param array $arguments The method arguments |
||
114 | * |
||
115 | * @return mixed |
||
116 | */ |
||
117 | public function __call($method, $arguments) |
||
121 | |||
122 | /** |
||
123 | * @param String $eventName |
||
124 | * @param DelayEvent $event |
||
125 | * |
||
126 | * @return bool |
||
127 | */ |
||
128 | 1 | private function isEventEligible($eventName, DelayEvent $event) |
|
132 | } |
||
133 |