Skip to content

RemoveUselessReturnTagRector doesn't recognize tag comments on a new line given a PHP core type hint#4482

Closed
TravisCarden wants to merge 1 commit intorectorphp:mainfrom
TravisCarden:patch-2
Closed

RemoveUselessReturnTagRector doesn't recognize tag comments on a new line given a PHP core type hint#4482
TravisCarden wants to merge 1 commit intorectorphp:mainfrom
TravisCarden:patch-2

Conversation

@TravisCarden
Copy link
Copy Markdown
Contributor

Bug Report

Subject Details
Rector version last dev-main
Installed as composer dependency

RemoveUselessReturnTagRector doesn't seem to recognize @return tag comments if they're on a new line and the @return has PHP core type hint--it incorrectly considers the @param useless.

Minimal PHP Code Causing Issue

See https://getrector.com/demo/2f905b5e-abf3-4268-b95f-096f49fd8b3f

Responsible rules

  • RemoveUselessReturnTagRector

Expected Behavior

Rector should skip it.

@samsonasik
Copy link
Copy Markdown
Member

@TravisCarden I cherry-picked your commit at PR #4817

@TravisCarden
Copy link
Copy Markdown
Contributor Author

Nice, thanks, @samsonasik!

@TravisCarden TravisCarden deleted the patch-2 branch August 21, 2023 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants