Skip to content

[DeadCode] Deprecate RemoveDuplicatedReturnSelfDocblockRector - #8634

Merged
TomasVotruba merged 1 commit into
mainfrom
deprecate-remove-duplicated-return-self-docblock
Oct 11, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
deprecate-remove-duplicated-return-self-docblock

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Deprecates RemoveDuplicatedReturnSelfDocblockRector.

Removing a @return self/@return static/@return $this docblock that looks duplicated with the native return type is tricky and sometimes intentional - the docblock can carry narrowing or author intent that the native type does not. This is better handled with static analysis and full context than a mechanical rule.

  • Marks the rule @deprecated + implements DeprecatedInterface, refactor() throws
  • Removes it from the DeadCode level set
  • Drops the rule tests

@TomasVotruba
TomasVotruba merged commit f4bca02 into main Oct 11, 2026
49 checks passed
@TomasVotruba
TomasVotruba deleted the deprecate-remove-duplicated-return-self-docblock branch October 11, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant