1 | <?php |
||
12 | final class TransactionalEmitter implements EmitterInterface, Transactional |
||
13 | { |
||
14 | /** @var EmitterInterface */ |
||
15 | private $emitter; |
||
16 | |||
17 | /** @var array */ |
||
18 | private $events = []; |
||
19 | |||
20 | /** @var bool */ |
||
21 | private $running; |
||
22 | |||
23 | /** |
||
24 | * Constructor. |
||
25 | * |
||
26 | * @param EmitterInterface $emitter |
||
27 | */ |
||
28 | public function __construct(EmitterInterface $emitter) |
||
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | public function emit($event) |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function beginTransaction() |
||
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | public function commit() |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function rollback() |
||
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | public function removeListener($event, $listener) |
||
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | public function useListenerProvider(ListenerProviderInterface $provider) |
||
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | public function removeAllListeners($event) |
||
103 | |||
104 | /** |
||
105 | * {@inheritdoc} |
||
106 | */ |
||
107 | public function hasListeners($event) |
||
111 | |||
112 | /** |
||
113 | * {@inheritdoc} |
||
114 | */ |
||
115 | public function getListeners($event) |
||
119 | |||
120 | /** |
||
121 | * {@inheritdoc} |
||
122 | */ |
||
123 | public function emitBatch(array $events) |
||
133 | |||
134 | /** |
||
135 | * {@inheritdoc} |
||
136 | */ |
||
137 | public function emitGeneratedEvents(GeneratorInterface $generator) |
||
141 | |||
142 | /** |
||
143 | * {@inheritdoc} |
||
144 | */ |
||
145 | public function addListener($event, $listener, $priority = self::P_NORMAL) |
||
149 | |||
150 | /** |
||
151 | * {@inheritdoc} |
||
152 | */ |
||
153 | public function addOneTimeListener($event, $listener, $priority = self::P_NORMAL) |
||
157 | |||
158 | /** |
||
159 | * @param Event $event |
||
160 | */ |
||
161 | private function addEvent(Event $event) |
||
165 | } |
||
166 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: