| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | private function namedServer(string $class) : string |
||
| 20 | { |
||
| 21 | $segments = array_map(static function ($p) { |
||
| 22 | return lcfirst($p); |
||
| 23 | }, explode('\\', $class)); |
||
| 24 | |||
| 25 | while ($segments) { |
||
|
|
|||
| 26 | if (Scanner::CLIENTS_NAME === $pop = array_pop($segments)) { |
||
| 27 | break; |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | return implode('.', $segments); |
||
| 32 | } |
||
| 34 |
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.