Skip to content

Add RemoveUselessTypeInParamTagRector rule #5811

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

alexandre-daubois
Copy link

As discussed here symfony/symfony#54489 (comment), this rule would help achieve this in the whole codebase. That would be great to see this rule bundled in Rector directly 🙂

Comment on lines +2976 to +2977
+ * @param $a
+ * @param $b description
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wrong, and param tag become mixed, and there is already RemoveUselessParamTagRector to remove useless param tag https://github.com/rectorphp/rector-src/blob/main/build/target-repository/docs/rector_rules_overview.md#removeuselessparamtagrector for it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The param doesn't become mixed ; the type is optional, as stated here. It can be omitted and avoid duplicating info. I still think this could be a great addition. The goal here is not to remove useless param, it removes useless type in @param when it is already present in the method signature 🙂

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can create your own custom rule for that.

@samsonasik samsonasik closed this Apr 8, 2024
@samsonasik
Copy link
Member

samsonasik commented Apr 8, 2024

I am closing it :), see the reasoning #5811 (review), you can create your own custom rule for your usecase.

@rectorphp rectorphp locked as resolved and limited conversation to collaborators Apr 8, 2024
@alexandre-daubois alexandre-daubois deleted the dev-useless-param-type branch April 8, 2024 14:04
@alexandre-daubois alexandre-daubois restored the dev-useless-param-type branch April 8, 2024 14:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants