| Conditions | 4 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | private static function getLookupTable(): array |
||
| 31 | { |
||
| 32 | if (!self::$lookupTable) { |
||
|
|
|||
| 33 | $values = self::getValidValues(); |
||
| 34 | self::$lookupTable = []; |
||
| 35 | foreach ($values as $value) { |
||
| 36 | self::$lookupTable[$value] = $value; |
||
| 37 | } |
||
| 38 | foreach ($values as $key => $value) { |
||
| 39 | self::$lookupTable[$key] = $value; |
||
| 40 | } |
||
| 41 | } |
||
| 42 | return self::$lookupTable; |
||
| 43 | } |
||
| 51 |
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.