| Total Complexity | 5 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class IniLoader implements DataInterface |
||
| 6 | { |
||
| 7 | |||
| 8 | use DataTrait; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * @var IniWriter |
||
| 12 | */ |
||
| 13 | protected $writer; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @return IniWriter |
||
| 17 | */ |
||
| 18 | protected function writer() |
||
| 19 | { |
||
| 20 | if (!$this->writer) |
||
| 21 | { |
||
| 22 | $this->writer = new IniWriter(); |
||
| 23 | } |
||
| 24 | |||
| 25 | return $this->writer; |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @inheritdoc |
||
| 30 | */ |
||
| 31 | public function asArray() |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @inheritdoc |
||
| 43 | */ |
||
| 44 | public function save($data) |
||
| 50 | } |
||
| 51 | |||
| 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.