-
Notifications
You must be signed in to change notification settings - Fork 509
Fix "Named arguments are supported only on PHP 8.0 and later." false positive #4032
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
Conversation
I think the underlying problem is, that we remember PHP_VERSION_ID when narrowing and therefore fallback to a wrong scope-state. see the scope-dump before/after the IF in this snippet: my current fix is wrong though |
This pull request has been marked as ready for review. |
@@ -34,6 +34,8 @@ | |||
final class ConstantResolver | |||
{ | |||
|
|||
public const PHP_MIN_ANALYZABLE_VERSION_ID = 50207; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this constant might need a better name. couldn't come up with something better.
the remaining failing tests are the same ones as in another just rebased PR of mine, therefore I think the errors are not related to this PR |
Thank you! |
running https://phpstan.org/r/8df32644-1f4b-4b46-934d-5134753fbd47 in a codebase outside of phpstan-src did not reproduce the error
putting the reproducer under
CallMethodsRuleTest
did also not reproduce the error, asignore-by-php-version.neon.php
is not loaded in the test-suite