varexporter icon indicating copy to clipboard operation
varexporter copied to clipboard

nikic/php-parser v5

Open dereuromark opened this issue 1 year ago • 10 comments

My app reported:

packages are not up to date:

  - nikic/php-parser (v4.18.0) latest is v5.0.0


brick/varexporter         0.4.0   requires nikic/php-parser (^4.0)          
cakephp/bake              3.0.5   requires nikic/php-parser (^4.13.2)       
phpunit/php-code-coverage 10.1.11 requires nikic/php-parser (^4.18 || ^5.0) 
sebastian/complexity      3.2.0   requires nikic/php-parser (^4.18 || ^5.0) 
sebastian/lines-of-code   2.0.2   requires nikic/php-parser (^4.18 || ^5.0) 

dereuromark avatar Jan 24 '24 02:01 dereuromark

Good point, php-parser v5 has been released a couple weeks ago. However, Psalm still supports v4 only, so our dev dependencies are locked to php-parser v4, and we cannot run tests with v5 unless we create another composer.json just for Psalm (which could make sense, but adds a bit to maintenance).

Should we just wait until Psalm becomes compatible with v5? Looks like it's a work in progress: https://github.com/vimeo/psalm/pull/10567

BenMorel avatar Feb 04 '24 12:02 BenMorel

FYI Psalm update is released

Fahl-Design avatar Feb 12 '24 12:02 Fahl-Design

@Fahl-Design AFAICS, https://github.com/vimeo/psalm/pull/10567 has been merged into master but not 5.x, so not released yet :/

BenMorel avatar Feb 17 '24 23:02 BenMorel

Oh, my bad.. for now I ended up with a hacky fork and "composer provides" in the same package, until it's released ;)

Fahl-Design avatar Feb 20 '24 09:02 Fahl-Design

What about require psalm as phar https://github.com/vimeo/psalm/blob/5.x/docs/running_psalm/installation.md#using-the-phar ?

snapshotpl avatar Feb 27 '24 10:02 snapshotpl

What about require psalm as phar https://github.com/vimeo/psalm/blob/5.x/docs/running_psalm/installation.md#using-the-phar ?

I usually find using tools via phars a bit cumbersome, as using composer is more convenient.

That said, this option (from that same link) might be a good alternative with the best of both worlds composer require --dev psalm/phar.

PHPStan has been shipping as a phar but via composer, for some time already. I wish more tools took that approach.

acelaya avatar Feb 27 '24 10:02 acelaya

@acelaya & @snapshotpl are there any updates on the PR to upgrade to nikic/php-parser v5?

I am also experiencing issues when upgrading to Laravel 11 which requires v5 via phpunit. https://github.com/statikbe/laravel-filament-chained-translation-manager/issues/37

Thank you!

sten avatar Apr 29 '24 21:04 sten

I have created #33 as first step to upgrade nikic/php-parser to v5, but still quiet :disappointed:

snapshotpl avatar Apr 30 '24 07:04 snapshotpl

Sorry for the delay. Let's merge #33, and I'll add support for php-parser v5 thereafter.

BenMorel avatar Apr 30 '24 20:04 BenMorel

@snapshotpl could you apply requested changes to your PR so that it can be merged and things can move forward?

acelaya avatar May 05 '24 12:05 acelaya

At first glance it looks like supporting nikic/php-parser v4 & v5 at the same time would be a pain. I'll probably release brick/varexporter v0.5 with support for nikic/php-parser v5 only.

BenMorel avatar May 10 '24 00:05 BenMorel

Fixed in 0.5.0!

BenMorel avatar May 10 '24 17:05 BenMorel