| Total Complexity | 3 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 44.44% |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class PHPLoader implements DataInterface |
||
| 6 | { |
||
| 7 | |||
| 8 | use DataTrait; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * @inheritdoc |
||
| 12 | */ |
||
| 13 | 1 | public function asArray() |
|
| 14 | { |
||
| 15 | 1 | if (!$this->data) |
|
|
|
|||
| 16 | { |
||
| 17 | 1 | $this->data = require $this->path; |
|
| 18 | } |
||
| 19 | |||
| 20 | 1 | return $this->data; |
|
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @inheritdoc |
||
| 25 | */ |
||
| 26 | public function save($data) |
||
| 33 | ); |
||
| 34 | } |
||
| 37 |
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.