-
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
Add missing @param and @return PHPDoc attributes #8543
Add missing @param and @return PHPDoc attributes #8543
Conversation
I'll look at and fix the problems reported from the CS job after your general feedback. I like to put the psalm param always directly after the normal param but there might be completely opposite opinions. |
You can have a look at the files changed tab, it will show comments on lines that have issues. You can fix many of those by running |
That might make sense, but would require a contribution to
|
That looked like easy to achieve if I did not miss anything. |
b60db93
to
bf326c9
Compare
Hi @greg0ire, |
Ok, but let's first resolve this: doctrine/coding-standard#238 |
@simonberger done :) |
2c97c40
to
f47aa2c
Compare
@greg0ire I rebased to 2.8, resolved conflicts and went through the list of all changes afterwards. |
@simonberger out of curiosity, what IDE did you have issue with and with which syntax? |
@orklah I hadn't really any problem yet. I just fix issues introduced in the psalm optimizations lately. |
Ok. just FYI, PHPStorm in recent version is able to parse and understand |
Yes that's correct and for me it would also be enough. All other IDEs which are not PHPStorm at this point don't understand this notation though. You can find some more context here #8539 (review) |
64bb314
to
eacee11
Compare
It does, in the limit of their inference engine. Basically, if there's an |
If someone is willing to review this PR I am solving the conflicts a last time, Otherwise I'll close it by the end of next week. |
I will review the PR. Please rebase on |
eacee11
to
c7f312d
Compare
@greg0ire Rebased on 2.9. Ready to review. Unfortunately I cannot check the pipeline. Possible that there are some small reports. |
3b96d5e
to
d875b1f
Compare
d875b1f
to
a26ae06
Compare
Unfortunately I cannot check the pipeline. You can still run Psalm and Phpstan locally, as well as
There were indeed some, I fixed them and I updated the baseline files so we can see how beneficial your changes are 🙂
Did that for you too 🙂 |
Thanks @simonberger ! |
Thank you @greg0ire
I think most of the changes on the baseline are unrelated to my changes though, as they are mainly solving type-holes IDEs might have. :) |
Oh right, that would be previous PRs 😅 |
After the recent CS improvement batches some
@param
attributes had been replaced by@psalm-param
which removes information for IDEs which are not interpreting those attributes. Same goes for@return
.This is the first step of two or three. What imho should follow and what I am willing to do (if you like this PR) is:
@param
which usesarray<>
orarray{}
syntax should be changed to@psalm-param
and like in this PR duplicated+fixed for@param
(same goes for@return
again).@var
and@psalm-var
I left this out here./cc @greg0ire