Skip to content

[DeadCode] Move RemoveReadonlyPropertyVisibilityOnReadonlyClassRector to dead-code set - #8289

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

[DeadCode] Move RemoveReadonlyPropertyVisibilityOnReadonlyClassRector to dead-code set#8289
TomasVotruba merged 1 commit into
mainfrom
move-readonly-visibility-rule-to-dead-code

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

The rule removes redundant visibility-less readonly noise on readonly classes, where the property readonly modifier is already implied. That is dead code removal rather than code quality, so it fits the dead-code set better.

 final readonly class SomeClass
 {
-    public readonly string $name;
+    public string $name;

-    public function __construct(private readonly int $age)
+    public function __construct(private int $age)
     {
     }
 }

The rule class stays in the CodeQuality namespace; only the set registration moves from CodeQualityLevel to DeadCodeLevel.

@TomasVotruba
TomasVotruba merged commit 9a0bd56 into main Aug 4, 2026
64 checks passed
@TomasVotruba
TomasVotruba deleted the move-readonly-visibility-rule-to-dead-code branch August 4, 2026 16:15
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