-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Check for use of deprecated API with Psalm #8691
Conversation
DeprecatedMethod was just an example I gave. There are a lot more deprecated* issue handlers in Psalm https://github.com/vimeo/psalm/blob/master/docs/running_psalm/error_levels.md: DeprecatedClass Maybe would be easier to bump psalm to level 3? |
We'd have to bump to level 2, as the |
As a follow-up, here's the output when moving to level 2:
And just for shits and giggles, here's what happens when we include tests:
|
Ok. What about other Deprecated* issue handlers? Do you want to include them in this PR, or you think DeprecatedMethod will do? |
I'd add all others, but as you said: it might be easier to go to level 2. This puts more restrictions on new codes with existing issues being safely ignored through the baseline. |
This converts more issues to errors, most notably around deprecations. This can be used to later remove deprecated API.
About that, @beberlei proposed to have some kind of sample calling code instead. That's looks a lot like what Marco did on the DBAL recently: doctrine/dbal#4638 |
68e9c5d
to
22ce3ad
Compare
Then let's not add tests. I've pushed a change to check level 2. |
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.
Looks good! Is there a Psalm command that allows to only see the deprecations?
Thanks @alcaeus ! |
Follow-up to #8689.
This enables checks for usage of deprecated API in the psalm configuration and also updates the baseline to not report any errors. Deprecations will be fixed gradually.