Skip to content

Remove redundant type in @param occurrences #54523

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

Closed

Conversation

alexandre-daubois
Copy link
Member

@alexandre-daubois alexandre-daubois commented Apr 8, 2024

Q A
Branch? 7.1
Bug fix? no
New feature? no
Deprecations? no
Issues -
License MIT

This decision was stated in many places, here is the most recent (I guess).

A Rector rule did the job, however it was not accepted in the upstream:

Still I applied it + PHP CS Fixer phpdoc_align with vertical to get this result. Finally, an issue has been reported to Jetbrains so PHPStorm may supports this syntax: https://youtrack.jetbrains.com/issue/WI-76947/Allow-param-to-omit-the-type. 🤞

@derrabus
Copy link
Member

derrabus commented Apr 8, 2024

How's tool support for this syntax these days?

@alexandre-daubois
Copy link
Member Author

  • PHPStorm struggles with this, hope my issue in Jetbrains' Youtrack gets some attention!
  • Psalm seems ok, as it didn't complain in this PR
  • PHPStan handles it well: https://phpstan.org/r/e471345c-3f0b-4a71-a593-c72639017700
  • phpDocumentor defines the type as optional so it's also fine
  • VSCode seems also fine with it

Am I missing something? I'd be happy to test more!

@nicolas-grekas
Copy link
Member

Please allow me to close here as this would need some automation to enforce in the long run. At the moment, this isn't worth the review+conflict-resolution time this will create IMHO.

@alexandre-daubois
Copy link
Member Author

Fair enough 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants