# Bug Report <!-- First, thank you for reporting a bug. That takes time and we appreciate that! --> | Subject | Details | | :------------- | :--------------------| | Rector version | last dev-main | | Installed as | composer dependency | ## Minimal PHP Code Causing Issue See https://getrector.com/demo/0c25aa4c-8237-414c-8bd8-4049150a44bc ```php <?php final readonly class A { /** @var string[] */ private array $arr; } ``` ### Responsible rules * `AddArrayDefaultToArrayPropertyRector` ## Expected Behavior Setting a default for a readonly property is not possible. Rector should not propose the change in this case.
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.com/demo/0c25aa4c-8237-414c-8bd8-4049150a44bc
Responsible rules
AddArrayDefaultToArrayPropertyRectorExpected Behavior
Setting a default for a readonly property is not possible. Rector should not propose the change in this case.