Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nikic/php-parser v5 support #11035

Open
wants to merge 12 commits into
base: 5.x
Choose a base branch
from

Conversation

VincentLanglet
Copy link
Contributor

No description provided.

@VincentLanglet VincentLanglet deleted the nikic5 branch July 3, 2024 09:54
@VincentLanglet VincentLanglet force-pushed the nikic5 branch 4 times, most recently from 5b4cba4 to 6358029 Compare July 25, 2024 12:22
@VincentLanglet VincentLanglet changed the title Try to add nikic/php-parser v5 support Add nikic/php-parser v5 support Jul 25, 2024
composer.json Outdated Show resolved Hide resolved
@VincentLanglet VincentLanglet marked this pull request as ready for review August 9, 2024 18:11
@VincentLanglet VincentLanglet requested a review from SCIF August 9, 2024 18:11
Copy link
Contributor

@edsrzf edsrzf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran this over a code base that's still using php-parser 4. There's a problem with usePHPParserV4, which I've commented on, but with that fixed it seems to work.

Do we need to look at running tests against php-parser 4 as well?

src/Psalm/Internal/BCHelper.php Outdated Show resolved Hide resolved
@VincentLanglet VincentLanglet force-pushed the nikic5 branch 12 times, most recently from 6b17670 to e7c21a4 Compare August 10, 2024 13:26
@VincentLanglet
Copy link
Contributor Author

VincentLanglet commented Aug 10, 2024

I ran this over a code base that's still using php-parser 4. There's a problem with usePHPParserV4, which I've commented on, but with that fixed it seems to work.

Do we need to look at running tests against php-parser 4 as well?

Thanks. I added the CI "lowest" with php parser 4 and fixed the build.

@VincentLanglet VincentLanglet requested a review from edsrzf August 10, 2024 13:33
@VincentLanglet
Copy link
Contributor Author

Friendly ping @weirdan if you have time to take a look (or can ping another maintainer ?).
This PR would be really helpful, by allowing to use both Psalm and PHPunit 11.

@weirdan
Copy link
Collaborator

weirdan commented Sep 8, 2024

Yeah, it's on my todo list. The thing is big, so it'll take me some time.

@weirdan
Copy link
Collaborator

weirdan commented Oct 12, 2024

Since we expose parts of PhpParser in our API this cannot go into 5.x line. So instead of merging this I'm going to fork 6.x from the current 5.x (not master) and then use this PR as a base for PhpParser 5.x upgrade. 6.x will be a transitional, hopefully short-lived, series with the same platform requirements as 5.x.

Thanks for all your work, this will make it easier.

@ghostwriter
Copy link

If the branch-alias in the master branch is preventing you from using the 6.x branch (causing it to pull the master branch instead of referencing the correct commit from the 6.x branch), add #{commit_sha} to specify the correct branch.

For example:

"vimeo/psalm": "6.x-dev#0f796f1"

Replace 0f796f1 with the latest commit SHA for accurate results.

@bensinclair
Copy link

Any update on this? I'm unable to install vimeo/psalm due to not support version 5 of nikic/php-parser.

@edsrzf
Copy link
Contributor

edsrzf commented Nov 14, 2024

In addition to the dependency conflicts with various packages, nikic/php-parser 5 is required to parse new PHP 8.4 features: property hooks and asymmetric visibility.

PHP 8.4 releases in about a week. Currently Psalm is unable to parse these constructs, let alone type check them, so Psalm users will be blocked from adopting these new language features.

@WyriHaximus
Copy link

In addition to the dependency conflicts with various packages, nikic/php-parser 5 is required to parse new PHP 8.4 features: property hooks and asymmetric visibility.

PHP 8.4 releases in about a week. Currently Psalm is unable to parse these constructs, let alone type check them, so Psalm users will be blocked from adopting these new language features.

It's this + that it's blocking anything else using nikic/php-parser 5 from being used with Psalm in the same package. PHPStan v2 and many more at this point.

@amdlemos
Copy link

Any update on this? I'm unable to install vimeo/psalm due to not support version 5 of nikic/php-parser.

I installed phar with composer itself, but when I tried to install the laravel plugin, there was a conflict 🙃

@mindriven
Copy link

+1, would love to see this one working

@felipefrancisco
Copy link

+1

@danog
Copy link
Collaborator

danog commented Dec 25, 2024

Please use directly dev-master until I tag a v6 (hopefully in January)

@vimeo vimeo deleted a comment from onethumb Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.