| 1 | <?php |
||
| 8 | class Options implements OptionsInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var array |
||
| 12 | */ |
||
| 13 | private $db; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param string $name |
||
| 17 | * @return OptionsInterface |
||
| 18 | */ |
||
| 19 | 25 | public function setDb(string $name): OptionsInterface |
|
| 28 | |||
| 29 | /** |
||
| 30 | * @inheritdoc |
||
| 31 | */ |
||
| 32 | 14 | public function jsonSerialize() |
|
| 42 | } |
||
| 43 |
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.