-
Notifications
You must be signed in to change notification settings - Fork 509
Resolve substr based on configured PHP version #4061
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
base: 1.12.x
Are you sure you want to change the base?
Conversation
6c212e9
to
364fbed
Compare
@@ -4,7 +4,7 @@ | |||
|
|||
use PHPStan\Testing\TypeInferenceTestCase; | |||
|
|||
class LooseConstComparisonPhp7Test extends TypeInferenceTestCase | |||
class NodeScopeResolverPhp7Test extends TypeInferenceTestCase |
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.
Since the neon file is only
parameters:
phpVersion: 70400 # PHP 7.4
we could use those TestCase for all the configured-phpVersion-related tests instead of creating a TestCase every time.
This pull request has been marked as ready for review. |
@@ -0,0 +1,9 @@ | |||
<?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.
I think you can add the lint
comment which makes the file beeing analyzed in the proper version
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.
The lint comment is for the runtime PHP version no ? (Like it's done for a lot of NodeScopeResolverPHPTest).
Here I want to allow Analysing this file on both PHP 7 and PHP 8, but telling PHPStan to consider he's in PHP 7.
btw: since phpunit got upgraded on the PHPStan 2.x branch, we need to be careful to send PRs to PHPStan 1.12.x only when easy mergabe into 2.x (attributes got added etc) |
Only change is this attribute I dunno if it will even create a conflict but if ondrej ask, I can target 2.1.x instead :) |
Closes phpstan/phpstan#13129