Fork me on GitHub
a Sensio Labs Product

Exceptional Exception (v3.93.1) edition

Rule no_redundant_readonly_property

Removes redundant readonly from properties in readonly classes.

Examples

Example #1

--- Original
+++ New
 <?php
 readonly class Foo
 {
-    private readonly int $bar;
+    private int $bar;
 }

References

The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.