Skip to content

[Config] Move 3 rules from coding style set to their proper sets - #8266

Merged
TomasVotruba merged 1 commit into
mainfrom
move-rules-to-proper-sets
Aug 2, 2026
Merged

[Config] Move 3 rules from coding style set to their proper sets#8266
TomasVotruba merged 1 commit into
mainfrom
move-rules-to-proper-sets

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

These 3 rules are not coding style, but belong to other sets:

1) RemoveFinalFromConstRector → dead code set

The final on a constant of a final class is dead noise:

 final class SomeClass
 {
-    final public const NAME = 'value';
+    public const NAME = 'value';
 }

Placed in the "easy picks" group, as it removes a redundant keyword only.

2) ExplicitPublicClassMethodRector → php 5.3 set

Explicit visibility is a PHP 5 upgrade step, same family as VarToPublicPropertyRector:

 class SomeClass
 {
-    function run()
+    public function run()
     {
     }
 }

3) TernaryConditionVariableAssignmentRector → code quality set

Not a style choice, but a simplification, next to the other ternary rules:

 function ternary($value)
 {
-    $value ? $a = 1 : $a = 0;
+    $a = $value ? 1 : 0;
 }

The rule classes keep their current namespace, only the set registration moves. The SetRectorsResolverTest count is bumped, as the php 5.3 set has one more rule now.

- RemoveFinalFromConstRector -> dead code set (easy picks)
- ExplicitPublicClassMethodRector -> php 5.3 set
- TernaryConditionVariableAssignmentRector -> code quality set
@TomasVotruba
TomasVotruba enabled auto-merge (squash) August 2, 2026 21:57
@TomasVotruba
TomasVotruba merged commit e73b182 into main Aug 2, 2026
64 checks passed
@TomasVotruba
TomasVotruba deleted the move-rules-to-proper-sets branch August 2, 2026 21:58
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