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 | public function __construct(EventDispatcherInterface $dispatcher, array $eligibleEventNames) |
||
36 | |||
37 | /** |
||
38 | * {@inheritDoc} |
||
39 | */ |
||
40 | public function dispatch($eventName, Event $event = null) |
||
53 | |||
54 | /** |
||
55 | * {@inheritDoc} |
||
56 | */ |
||
57 | public function addListener($eventName, $listener, $priority = 0) |
||
61 | |||
62 | /** |
||
63 | * {@inheritDoc} |
||
64 | */ |
||
65 | public function addSubscriber(EventSubscriberInterface $subscriber) |
||
69 | |||
70 | /** |
||
71 | * {@inheritDoc} |
||
72 | */ |
||
73 | public function removeListener($eventName, $listener) |
||
77 | |||
78 | /** |
||
79 | * {@inheritDoc} |
||
80 | */ |
||
81 | public function removeSubscriber(EventSubscriberInterface $subscriber) |
||
85 | |||
86 | /** |
||
87 | * {@inheritDoc} |
||
88 | */ |
||
89 | public function getListeners($eventName = null) |
||
93 | |||
94 | /** |
||
95 | * {@inheritDoc} |
||
96 | */ |
||
97 | public function hasListeners($eventName = null) |
||
101 | |||
102 | /** |
||
103 | * Proxies all method calls to the original event dispatcher. |
||
104 | * |
||
105 | * @param string $method The method name |
||
106 | * @param array $arguments The method arguments |
||
107 | * |
||
108 | * @return mixed |
||
109 | */ |
||
110 | public function __call($method, $arguments) |
||
114 | |||
115 | /** |
||
116 | * @param String $eventName |
||
117 | * @param Event $event |
||
118 | * |
||
119 | * @return bool |
||
120 | */ |
||
121 | private function isEventEligible($eventName, $event) |
||
125 | } |
||
126 |
It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):