Total Complexity | 3 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | class AggregateTest extends TestCase |
||
11 | { |
||
12 | public function testProvidesAllListeners(): void |
||
13 | { |
||
14 | $event = new Event(); |
||
15 | |||
16 | $provider1 = new class implements ListenerProviderInterface |
||
17 | { |
||
18 | public function getListenersForEvent(object $event): iterable |
||
24 | }; |
||
25 | |||
26 | $provider2 = new class implements ListenerProviderInterface |
||
27 | { |
||
28 | public function getListenersForEvent(object $event): iterable |
||
46 | } |
||
47 |
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: