| 1 | <?php |
||
| 7 | class JsonObject |
||
| 8 | { |
||
| 9 | private $data; |
||
| 10 | |||
| 11 | public function __construct(array $data) |
||
| 15 | |||
| 16 | public static function fromFilePath(string $filePath) : self |
||
| 32 | |||
| 33 | public static function fromArray(array $data) : self |
||
| 37 | |||
| 38 | public function get($keys = [], $default = null) |
||
| 50 | |||
| 51 | private function deepGet(array $current, array $keys = [], $default = null) |
||
| 62 | } |
||
| 63 |
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.