Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
38 | 80 | private static function isUnder43() |
|
39 | { |
||
40 | 80 | static $result = null; |
|
41 | |||
42 | 80 | if (null === $result) { |
|
43 | 5 | $reflectionMethod = new \ReflectionMethod(EventDispatcherInterface::class, 'dispatch'); |
|
44 | 5 | $reflectionParameters = $reflectionMethod->getParameters(); |
|
45 | 5 | $result = count($reflectionParameters) >= 2 && 'event' === $reflectionParameters[1]->getName(); |
|
46 | 3 | } |
|
47 | |||
48 | 80 | return $result; |
|
49 | } |
||
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: