pcov
pcov copied to clipboard
Reporting method curly braces ( `{` and `}`) as not covered, but method content as covered
Hi !
Very weird : since a few weeks/months, method curly braces ( { and }) are reported as not covered , even if the method declaration and content are reported as covered (and they are actually covered).
Command used :
php \
-d pcov.enabled=1 \
-d pcov.directory=src \
-d pcov.initial.files=2048 \
-d memory_limit=-1 \
bin/phpunit --log-junit junit.xml --coverage-clover clover.xml -c phpunit.xml.dist
The coverage is then sent to SonarCloud, and the uncovered lines break our Quality Gate.
Fro example, this DTO :

What's going on ? How can I fix this ? Is it a configuration issue or a bug ?
Thanks for your help !
Hi Check your newlines, this happens when you have windows-style line separators- CLRF (\r\n) instead of linux (\n)
We have the same issue. Our line separators are linux style. Are there any other ideas where the problem comes from?