-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add support for PHPStan 2.0 #333
Comments
Was already waiting for someone to request PHPStan 2.0 compatibility :) I totally want to support PHPStan 2.0 but I can't give you a timeframe for it. I broke my ankle the other week and that complicates a few more things. Mind preparing a PR with your patch? That's probably a good start to work on other issues (if there are any). Since the older versions of the extension still work fine, I would let master "just" support PHPStan 2.x. Since older versions of the extension are still around, you can easily install the older versions. For now, I would want to avoid backporting features. |
Please don't tell me you're coding with your toes instead of your fingers? I'll see what I can do in terms of a pull request later this week. Do you have some preference in those error identifier names for this module? Should we use |
I think |
Here you go, a first attempt: #334 |
PHPStan 2.0 got released earlier today: https://github.com/phpstan/phpstan/releases/tag/2.0.0
We should take a look at the upgrade guide for extension developers in order to make this module compatible with version 2.
I already gave it a quick try on my local with a small module with the current codebase, and ran into an error:
This can be fixed in the codebase with something like this:
Or something similar. This transformation of returning
string
to aRuleError
should happen in more places. See https://phpstan.org/blog/using-rule-error-builderThese changes can probably also already be done for support with the PHPStan 1.12.0 compatibility (haven't tested it), maybe that's worth it to reduce the amount of code changes between supporting PHPStan 1.x and 2.x? In case you plan on keep supporting version 1.x for a while?
That's at least one thing that will need to be updated. So far haven't run into other things, but I only looked around for 15 minutes or so.
Thanks!
The text was updated successfully, but these errors were encountered: