1 | <?php |
||
8 | trait EmitterTrait |
||
9 | { |
||
10 | /** |
||
11 | * @param array ...$events The event triggered |
||
12 | * @return mixed |
||
13 | */ |
||
14 | public function emit(...$events) |
||
20 | |||
21 | /** |
||
22 | * @param EventInterface $event An event to emit |
||
23 | * @return mixed |
||
24 | */ |
||
25 | abstract public function emitEvent(EventInterface $event); |
||
26 | |||
27 | /** |
||
28 | * @param string $event An event name |
||
29 | * @return mixed |
||
30 | */ |
||
31 | abstract public function emitName($event); |
||
32 | |||
33 | /** |
||
34 | * @param string|EventInterface $event An event received |
||
35 | * @return mixed |
||
36 | */ |
||
37 | private function parseEvent($event) |
||
45 | } |
||
46 |
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: