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