You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 26, 2021. It is now read-only.
When running CodeCoverage::getLinesToBeIgnored(), PHP_Token_Stream::scan(), token_get_all() flips out because of the ASCII control characters in the file contents: Warning: Unexpected character in input: '' (ASCII=30) state=0 in vendor/phpunit/php-token-stream/src/Token/Stream.php on line 162
I suggest adding this line into scan() just before token_get_all(): $sourceCode = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/', '', $sourceCode);
h/t: https://stackoverflow.com/a/1497928/218967 plus allowing 09 (horiz tab) to stay
I was using this package successfully up until today. Today's also the first time I've run coverage reports on this codebase while in a Docker container. Could have something to do with the overlayfs file system this Debian (w/ coreutils 8.26) image?
Has something recently changed with the whitelisting feature in CodeCoverage? I used to be including /somefolder/* but noticed this was now scanning all files (png, ttf, txt, bmp, etc). This could also be why its even encountering these ASCII characters in the first place. I've updated my whitelist to /somefolder/*.php but don't think I should have had to.
The text was updated successfully, but these errors were encountered:
When running CodeCoverage::getLinesToBeIgnored(), PHP_Token_Stream::scan(), token_get_all() flips out because of the ASCII control characters in the file contents:
Warning: Unexpected character in input: '' (ASCII=30) state=0 in vendor/phpunit/php-token-stream/src/Token/Stream.php on line 162
All the ASCII characters it complained about: 1-8, 11, 12, 14-31. Or to put it another way, every non-printing (control) character except null, tab, new line and carriage return.
High level: http://www.asciitable.com/
For color commentary on each character: https://www.lammertbies.nl/comm/info/ascii-characters.html
I suggest adding this line into scan() just before token_get_all():
$sourceCode = preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/', '', $sourceCode);
h/t: https://stackoverflow.com/a/1497928/218967 plus allowing 09 (horiz tab) to stay
I was using this package successfully up until today. Today's also the first time I've run coverage reports on this codebase while in a Docker container. Could have something to do with the overlayfs file system this Debian (w/ coreutils 8.26) image?
Has something recently changed with the whitelisting feature in CodeCoverage? I used to be including /somefolder/* but noticed this was now scanning all files (png, ttf, txt, bmp, etc). This could also be why its even encountering these ASCII characters in the first place. I've updated my whitelist to /somefolder/*.php but don't think I should have had to.
The text was updated successfully, but these errors were encountered: