| Conditions | 4 |
| Paths | 3 |
| Total Lines | 5 |
| Code Lines | 3 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 26 | public function init($fields): void |
||
| 27 | { |
||
| 28 | if ($fields && \is_array($fields)) { |
||
|
|
|||
| 29 | foreach (\array_keys($fields) as $key) { |
||
| 30 | $this->initVar($key, $fields[$key]->getVar('field_valuetype'), $fields[$key]->getVar('field_default', 'n'), $fields[$key]->getVar('field_required'), $fields[$key]->getVar('field_maxlength')); |
||
| 31 | } |
||
| 35 |
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.