1 | <?php |
||
12 | class StateMachineDispatcher |
||
13 | { |
||
14 | /** |
||
15 | * @var EventDispatcherInterface |
||
16 | */ |
||
17 | private $eventDispatcher; |
||
18 | |||
19 | 90 | public function __construct(EventDispatcherInterface $eventDispatcher = null) |
|
23 | |||
24 | 80 | public function dispatch($eventName, StateMachineEvent $event) |
|
25 | { |
||
26 | 80 | if (self::isUnder43()) { |
|
27 | 80 | return $this->eventDispatcher->dispatch($eventName, $event); |
|
|
|||
28 | } |
||
29 | |||
30 | return $this->eventDispatcher->dispatch($event, $eventName); |
||
31 | } |
||
32 | |||
33 | 5 | public function addListener($eventName, $listener, $priority = 0) |
|
37 | |||
38 | 80 | private static function isUnder43() |
|
50 | } |
||
51 |
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: