1 | <?php |
||
11 | class RecordingDispatcher implements EventDispatcherInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var ContainerAwareEventDispatcher|EventDispatcherInterface |
||
15 | */ |
||
16 | private $originalDispatcher; |
||
17 | |||
18 | /** |
||
19 | * @var StatsdClientInterface |
||
20 | */ |
||
21 | private $statsdClient; |
||
22 | |||
23 | /** |
||
24 | * @param EventDispatcherInterface $originalDispatcher |
||
25 | * @param StatsdClientInterface $statsdClient |
||
26 | */ |
||
27 | public function __construct( |
||
34 | |||
35 | /** |
||
36 | * @see ContainerAwareEventDispatcher::addListenerService |
||
37 | */ |
||
38 | public function addListenerService($eventName, $callback, $priority = 0) |
||
42 | |||
43 | /** |
||
44 | * @see ContainerAwareEventDispatcher::addSubscriberService |
||
45 | */ |
||
46 | public function addSubscriberService($serviceId, $class) |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | public function dispatch($eventName, Event $event = null) |
||
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | public function addListener($eventName, $listener, $priority = 0) |
||
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | public function addSubscriber(EventSubscriberInterface $subscriber) |
||
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | */ |
||
79 | public function removeListener($eventName, $listener) |
||
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | public function removeSubscriber(EventSubscriberInterface $subscriber) |
||
91 | |||
92 | /** |
||
93 | * {@inheritdoc} |
||
94 | */ |
||
95 | public function getListeners($eventName = null) |
||
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | public function hasListeners($eventName = null) |
||
107 | |||
108 | /** |
||
109 | * {@inheritdoc} |
||
110 | */ |
||
111 | public function getListenerPriority($eventName, $listener) |
||
115 | } |
||
116 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: