Allow getenv(null) for PHP > 8#4007
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. |
ondrejmirtes
left a comment
There was a problem hiding this comment.
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.
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.
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.
Files in nsrt/ when testing type inference are filtered based on// lint as well.
There was a problem hiding this comment.
Oh ! Awesome !
|
Thank you. |
Closes phpstan/phpstan#13065