| 1 | <?php |
||
| 10 | final class SpyCompiler implements CompilerInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * {@inheritdoc} |
||
| 14 | */ |
||
| 15 | public function newInstance($class, array $args, BindInterface $bind) |
||
| 18 | |||
| 19 | /** |
||
| 20 | * {@inheritdoc} |
||
| 21 | */ |
||
| 22 | 1 | public function compile($class, BindInterface $bind) : string |
|
| 30 | |||
| 31 | 1 | private function hasNoBinding($class, BindInterface $bind) : bool |
|
| 37 | |||
| 38 | 1 | private function hasBoundMethod(string $class, BindInterface $bind) : bool |
|
| 50 | |||
| 51 | 1 | private function getInterceptors(BindInterface $bind) : string |
|
| 68 | } |
||
| 69 |
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.