Skip to content

[CodeQuality] Deprecate SwitchTrueToMatchRector - #8622

Merged
TomasVotruba merged 1 commit into
mainfrom
tv-deprecate-switch-true-to-match
Oct 11, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
tv-deprecate-switch-true-to-match

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Deprecate SwitchTrueToMatchRector.

Both switch (true) and match (true) are hacky constructions - swapping one for the other does not improve the code. A constant list or explicit mapping is clearer, and the change needs a human check rather than an automated rewrite.

Follows the same pattern as the recent InnerFunctionToPrivateMethodRector and MoveInnerFunctionToTopLevelRector deprecations:

  • rule body throws ShouldNotHappenException, marked @deprecated + DeprecatedInterface
  • unregistered from CodeQualityLevel
  • tests removed

@TomasVotruba
TomasVotruba force-pushed the tv-deprecate-switch-true-to-match branch from a4e6a8c to 028509c Compare October 11, 2026 10:04
@TomasVotruba
TomasVotruba merged commit 9f837c8 into main Oct 11, 2026
49 checks passed
@TomasVotruba
TomasVotruba deleted the tv-deprecate-switch-true-to-match branch October 11, 2026 10:05
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