| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | private function detectByFamily(): array |
||
| 31 | { |
||
| 32 | foreach ($this->config as $family => $data) { |
||
| 33 | if ($family === 'default') { |
||
| 34 | continue; |
||
| 35 | } |
||
| 36 | $os = $this->detectByDeviceType($family); |
||
| 37 | if ($os) { |
||
|
|
|||
| 38 | return array_merge($os, ['family' => $family]); |
||
| 39 | } |
||
| 40 | } |
||
| 41 | return []; |
||
| 42 | } |
||
| 43 | |||
| 55 | } |
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.