Skip to content

[deprecation] Deprecate SwitchTrueToIfRector#8109

Merged
TomasVotruba merged 2 commits into
mainfrom
deprecate-switch-true-to-if
Jun 29, 2026
Merged

[deprecation] Deprecate SwitchTrueToIfRector#8109
TomasVotruba merged 2 commits into
mainfrom
deprecate-switch-true-to-if

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Jun 29, 2026

Copy link
Copy Markdown
Member

Deprecates SwitchTrueToIfRector, following the same pattern as #8107 (JoinStringConcatRector).

The rule expands a compact switch (true) into many separate if statements, which worsens readability. For the same logic, match (true) is the better fit.

Checking open source Github repositories, this rule is often skipped.

@TomasVotruba TomasVotruba enabled auto-merge (squash) June 29, 2026 09:25
@TomasVotruba TomasVotruba merged commit d146323 into main Jun 29, 2026
65 checks passed
@TomasVotruba TomasVotruba deleted the deprecate-switch-true-to-if branch June 29, 2026 09:25
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.

2 participants