Skip to content

[DeadCode] Move SimplifyBoolIdenticalTrueRector and UnwrapSprintfOneArgumentRector to dead-code set - #8285

Merged
TomasVotruba merged 1 commit into
mainfrom
move-rules-to-dead-code
Aug 4, 2026
Merged

[DeadCode] Move SimplifyBoolIdenticalTrueRector and UnwrapSprintfOneArgumentRector to dead-code set#8285
TomasVotruba merged 1 commit into
mainfrom
move-rules-to-dead-code

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Both rules remove dead code rather than improve quality, so they fit the dead-code set better.

SimplifyBoolIdenticalTrueRector - dead comparison against a bool:

-$match = in_array($value, $items, true) === true;
+$match = in_array($value, $items, true);

UnwrapSprintfOneArgumentRector - dead sprintf() call with nothing to format:

-$value = sprintf('Hi');
+$value = 'Hi';

Namespaces stay as-is; only the set registration moves from CodeQualityLevel to DeadCodeLevel. Precedent: SimplifyUselessVariableRector already lives in DeadCodeLevel with its Rector\CodeQuality namespace.

…rgumentRector from code-quality to dead-code set
@TomasVotruba
TomasVotruba merged commit c7a7575 into main Aug 4, 2026
64 checks passed
@TomasVotruba
TomasVotruba deleted the move-rules-to-dead-code branch August 4, 2026 09:26
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