| 1 | <?php |
||
| 6 | class StatusChecker implements StatusCheckerInterface |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * registered ungrouped checks |
||
| 10 | * @var StatusCheckerGroup[] |
||
| 11 | */ |
||
| 12 | protected $ungroupedChecks; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var StatusCheckerGroup[] |
||
| 16 | */ |
||
| 17 | protected $results = array(); |
||
| 18 | |||
| 19 | public function addCheck(AbstractCheck $checker) |
||
| 27 | |||
| 28 | public function addGroup(StatusCheckerGroup $group) |
||
| 32 | |||
| 33 | public function check() |
||
| 39 | |||
| 40 | public function getResults(): array |
||
| 44 | |||
| 45 | public function hasErrors(): bool |
||
| 56 | } |
||
| 57 |
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.