1 | <?php |
||
11 | final class AnyMatcher extends AbstractMatcher |
||
12 | { |
||
13 | /** |
||
14 | * @var array |
||
15 | */ |
||
16 | private static $builtinMethods = []; |
||
17 | |||
18 | 22 | public function __construct() |
|
24 | |||
25 | 1 | private function setBuildInMethods() |
|
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | 1 | public function matchesClass(\ReflectionClass $class, array $arguments) |
|
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | 4 | public function matchesMethod(\ReflectionMethod $method, array $arguments) |
|
50 | |||
51 | /** |
||
52 | * @param string $name |
||
53 | * |
||
54 | * @return bool |
||
55 | */ |
||
56 | private function isMagicMethod($name) |
||
60 | |||
61 | /** |
||
62 | * @param string $name |
||
63 | * |
||
64 | * @return bool |
||
65 | */ |
||
66 | 4 | private function isBuiltinMethod($name) |
|
72 | } |
||
73 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.