1 | <?php |
||
14 | final class SpyCompiler implements CompilerInterface |
||
15 | { |
||
16 | /** |
||
17 | * {@inheritdoc} |
||
18 | */ |
||
19 | public function newInstance($class, array $args, BindInterface $bind) |
||
22 | |||
23 | /** |
||
24 | * {@inheritdoc} |
||
25 | */ |
||
26 | 1 | public function compile($class, BindInterface $bind) : string |
|
35 | |||
36 | 1 | private function hasNoBinding($class, BindInterface $bind) : bool |
|
42 | |||
43 | 1 | private function hasBoundMethod(string $class, BindInterface $bind) : bool |
|
55 | |||
56 | 1 | private function getInterceptors(BindInterface $bind) : string |
|
73 | } |
||
74 |
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.