Psalm: nikic/php-parser 4.7

Created on 6 Aug 2020  Â·  5Comments  Â·  Source: vimeo/psalm

Getting a conflict between psalm and my other dependencies because psalm only allows php-parser <4.7 while my other dependencies want 4.7+. It was recently restricted here. What's the issue with the newer version?

Most helpful comment

When using the emulated mode nikic/php-parser 4.7 cannot correctly parse the valid PHP 7.4 code <?php class Match {} (which appears in PHPUnit, among other places).

The latest master version of the parser has a fix for this – once there's a release I'll bump the requirement.

All 5 comments

Hey @enumag, can you reproduce the issue on https://psalm.dev ?

When using the emulated mode nikic/php-parser 4.7 cannot correctly parse the valid PHP 7.4 code <?php class Match {} (which appears in PHPUnit, among other places).

The latest master version of the parser has a fix for this – once there's a release I'll bump the requirement.

I see. In that case since you already know it will be fixed in the next version of php-parser you might want to bump the requirement to ^4.3 !=4.7.0. This would allow installing ^4.7@dev.

The latest master version of the parser has a fix for this – once there's a release I'll bump the requirement.

Just in case, PHP-Parser 4.8.0 is released.

@morozov ^4.8 is already in master branch, next release will have it sorted

Was this page helpful?
0 / 5 - 0 ratings