| Q |
A |
| php-code-coverage version |
9.2.9 |
| PHP version |
7.4.3 |
| Driver |
Xdebug |
| Xdebug version (if used) |
2.9.2 |
| Installation Method |
Composer |
| Usage Method |
PHPUnit |
| PHPUnit version (if used) |
9.5.10 |
Files that have only \r (CR, 0x0d) characters on line ends and having at least two comment lines cause failure:
Generating code coverage report in HTML format ... $nonCommentLinesOfCode must not be negative
Linux command wc -l shows 0 for these files beacuse it counts LF characters. Number of lines is 1 because no LF characters are in the file. $nonCommentLinesOfCode = 1-2 = -1 triggers the bug.
Macintosh files before OS X had this type of line endings.
Similar to previously fixed issue #831.