| Conditions | 5 |
| Paths | 4 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | protected function finishCommand(ErrorPrinter $errorPrinter) |
||
| 16 | { |
||
| 17 | $commandName = class_basename($this); |
||
| 18 | $commandType = Str::after($commandName, 'Check'); |
||
| 19 | $commandType = strtolower($commandType); |
||
| 20 | |||
| 21 | if (! $errorPrinter->logErrors) { |
||
| 22 | return; |
||
| 23 | } |
||
| 24 | |||
| 25 | if (($errorCount = $errorPrinter->hasErrors()) || $errorPrinter->pended) { |
||
|
|
|||
| 26 | $errorCount && $this->warn(PHP_EOL.$errorCount.' errors found for '.$commandType); |
||
| 27 | |||
| 28 | $errorPrinter->logErrors(); |
||
| 29 | } else { |
||
| 30 | $this->info(PHP_EOL.'All '.$commandType.' are correct!'); |
||
| 31 | } |
||
| 32 | } |
||
| 33 | } |
||
| 34 |
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.