| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | 1 | private function hasBoundMethod(string $class, BindInterface $bind) : bool |
|
| 44 | { |
||
| 45 | 1 | $bindingMethods = array_keys($bind->getBindings()); |
|
| 46 | 1 | $hasMethod = false; |
|
| 47 | 1 | foreach ($bindingMethods as $bindingMethod) { |
|
| 48 | 1 | if (method_exists($class, $bindingMethod)) { |
|
| 49 | 1 | $hasMethod = true; |
|
| 50 | } |
||
| 51 | } |
||
| 52 | |||
| 53 | 1 | return $hasMethod; |
|
| 54 | } |
||
| 55 | |||
| 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.