Closed arno09 closed 2 years ago
For me this happened when running on PHP8.1 code which uses some tokens with new indexes in the token map.
nikic/php-parser
has added support for php8.1 since 4.13.0.
I worked around it by installing this package via composer and manually requiring nikic/php-parser:^4.13.2
.
It seems all that is needed to fix this is a new build.
This commit: https://github.com/sebastianbergmann/php-code-coverage/commit/347a87a7f8b2b78e87200d7de0058dd4ae05f76d adds the correct version of php-parser
to the coverage library.
Phpcov requires phpunit/php-code-coverage: ^9.2
, and the fix (dependency update) is included from 9.2.8
onwards.
Since this repo does not include a composer.lock
file it is essentially saying that it'll work with dependency ranges as specified in the composer.json
file; if that's the case then maybe it makes sense to automatically rebuild the PHAR archive and do a minor release every time one of the dependencies comes with a new release.
Assumptions:
composer.json
are strict enoughToday is 2022-03-23 and still this issue are not fixed. its need just update dependencies as i understand. In readme phive way is recommended using this tool. Please fix it ASAP. Thank you.
Create PR for this. #117 For temporary published phar too in the fork.
When I'm running phpcov 8.2.0 on a php 8.1 environment with phpUnit 9.5.10 I've got this error :
For information, I get phpcov by doing
wget -q https://phar.phpunit.de/phpcov.phar -O phpcov