-
Notifications
You must be signed in to change notification settings - Fork 1.9k
chore: update PHPStan PHP version to 8.1 #6668
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
Since the version is specified in PHPStan config, there is no need to run in PHP 8.0.
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.
Shouldn't we be running PHPStan against each version of PHP we want to support? There doesn't appear to be a command line argument for it but we could have a config file for each that imports the main file.
Ideally yes, but IIRC we were not able to support PHP 7.4 and 8.0 at the same time. Or if we prepare |
It would be cumbersome to maintain, as shown before. We have code flagged by phpstan in a lower PHP version which we add |
It seems to me that rather than increasing the number of PHP versions to check, we should focus on reducing |
I disagree. Baselining is very easy, and if the only hindrance to supporting multiple PHP versions is the error variance then we just baseline them separately. There is nothing special about the baseline config- you can add the same type of error ignores to any. So we can have a single phpstan.neon.dist with whatever we want our "standard" to be, then phpstan-x.x.neon for each PHP version we want to support, including version-specific baselining. I would be glad to take on this work, I've been doing something similar at my day job. Let's proceed with this change now since it is ready, but please voice any objections in this thread. |
I think if we have phpstan-x.x.neon, we can run PHPStan for all supported PHP versions. |
What other language versioning safety nets do we have? Obviously if a test case tries to use a deprecated or not-yet-available feature that will fail, but that requires test coverage. I work regularly across 7.4, 8.0, and 8.1 these days and frequently have to look things up. Maybe other people have their heads around that better, but I don't necessarily trust myself to catch a mistake during a code review. |
Okay, it is true that the current code coverage is a bit low. |
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.
Let's proceed with this for now. The version of PHP running shouldn't affect the version of analysis.
Description
PHP 8.1 is the most used version with Composer.
Checklist: