-
Notifications
You must be signed in to change notification settings - Fork 509
Allow getenv(null) for PHP > 8 #4007
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
29e4b96
to
c2c7c8b
Compare
tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php
Outdated
Show resolved
Hide resolved
This pull request has been marked as ready for review. |
This pull request has been marked as ready for review. |
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.
I tried the delta change myself, it works.
if (PHP_VERSION_ID < 80000) { | ||
yield __DIR__ . '/data/getenv-php74.php'; | ||
} else { | ||
yield __DIR__ . '/data/getenv-php80.php'; |
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 doesn't need to be in NodeScopeResolverTest. Move the files to nsrt/ and label them with proper // lint
conditions.
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.
There is already similar conditions checks like above
if (PHP_VERSION_ID < 80000) {
yield __DIR__ . '/data/explode-php74.php';
} else {
yield __DIR__ . '/data/explode-php80.php';
}
The expectated type are different based on the PHP version, that's why I split the files.
The // lint
condition is only used for the linter, not for the tests right ?
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.
Files in nsrt/ when testing type inference are filtered based on// lint
as well.
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.
Oh ! Awesome !
Thank you. |
Closes phpstan/phpstan#13065