Require nikic/php-parser 5 only#183
Merged
bocharsky-bw merged 1 commit intophp-translation:masterfrom Dec 9, 2025
Merged
Conversation
bocharsky-bw
reviewed
Dec 9, 2025
| "require": { | ||
| "php": "^8.1", | ||
| "nikic/php-parser": "^4.0 || ^5.0", | ||
| "nikic/php-parser": "^5.0", |
Member
There was a problem hiding this comment.
Could you explain in more detail? I mean, the package allowed v5 before
Contributor
Author
There was a problem hiding this comment.
yes, but also v4, and v4 is not doesn't have ParserFactory()->createForVersion()
$parser = (new ParserFactory())->createForVersion(PhpVersion::fromString('8.1'));
So yeah, the change is more likely to disallow v4.
Member
There was a problem hiding this comment.
Ah ok, I see we use that createForVersion() in the code, thanks for more details
bocharsky-bw
approved these changes
Dec 9, 2025
Member
bocharsky-bw
left a comment
There was a problem hiding this comment.
OK, I don't think it will cause any problems cus nikic/php-parser literally has no deps. let's do it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PHPFileExtractor needs nikic/php-parser 5 since this commit 44d8690#diff-54aad4ca5a1c43e17f2d4722aa2448cd7686a6e9c9e41250ccd2c651414e0193