Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 3.0032 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
31 | 2 | private static function gather(iterable $directories): iterable |
|
32 | { |
||
33 | 2 | $mapperVersion = version_compare( |
|
34 | 2 | explode( |
|
35 | 2 | '@', |
|
36 | 2 | Versions::getVersion('wyrihaximus/tactician-command-handler-mapper') |
|
37 | 2 | )[0], |
|
38 | 2 | '2.0.0', |
|
39 | 2 | '<' |
|
40 | ); |
||
41 | |||
42 | 2 | foreach ($directories as $path => $namespace) { |
|
43 | 1 | $args = [$path]; |
|
44 | 1 | if ($mapperVersion) { |
|
45 | $args[] = $namespace; |
||
46 | } |
||
47 | 1 | yield from Mapper::map(...$args); |
|
48 | } |
||
49 | 2 | } |
|
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: