| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 50 | public static function printFiles(string $title, array $files): void |
||
| 51 | { |
||
| 52 | if (!$files) { |
||
|
1 ignored issue
–
show
|
|||
| 53 | return; |
||
| 54 | } |
||
| 55 | |||
| 56 | echo $title . PHP_EOL . PHP_EOL; |
||
| 57 | |||
| 58 | foreach ($files as $file) { |
||
| 59 | echo ' ' . escapeshellarg($file) . PHP_EOL; |
||
| 60 | } |
||
| 61 | echo PHP_EOL; |
||
| 62 | } |
||
| 64 |
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.