sebastianbergmann / phpcov

TextUI frontend for php-code-coverage
BSD 3-Clause "New" or "Revised" License
223 stars 58 forks source link

Add php83 compatibility with phpunit9 #141

Open abrahxas opened 4 months ago

abrahxas commented 4 months ago

Hello,

We have issue when merging coverage reports generated with PHPUnit 9.x, on a PHP 8.3 codebase, updating parser to bring support between PHP 8.3 and PHPUnit 9.x.

⚠️ This MR should target a 8.2 branch instead of main but no such branch seems to exist. ⚠️

sebastianbergmann commented 4 months ago

From your description it is not yet clear to me what the problem is you are aiming to solve.

sebastianbergmann commented 4 months ago

Please note that using phpcov to merge results from different PHP / PHPUnit versions is not supported and out of scope.

romain-jacquart commented 4 months ago

Hi,

Thanks for your quick reply.

We are trying to merge multiple coverage reports generated with PHPUnit 9.6.16 (and php-code-coverage 9.2.28), on a PHP 8.3 project.

We were using the 8.2.1 version of phpcov, but this particular version is not compatible with a PHP 8.3 codebase.

Fatal error: Uncaught PhpParser\Error: Syntax error, unexpected T_READONLY on line 5 in phar://.../phpcov.phar/nikic/PhpParser/ParserAbstract.php:318

Since we can't upgrade PHPUnit to v10 or v11, we have to stick with a version of phpcov which supports PHPUnit 9.x :

Using the v5.0.2 of nikic/php-parser seems to fix the phpcov code parser and our issue.