# 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/492d4ef9-bfd2-4a66-9f64-376697f98ad2 ```php <?php final readonly class A { public B|null $display; public function __construct( string|null $display = null, ) { if ($display === null) { $this->display = null; } else { $this->display = $display; } } } ``` ### Responsible rules * `RestoreDefaultNullToNullableTypePropertyRector` ## Expected Behavior 1) it shouldn't add default values to readonly properties https://3v4l.org/TLaUT#v8.2.7 2) The property is initialized in constructor so it should't try to add a default value
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.com/demo/492d4ef9-bfd2-4a66-9f64-376697f98ad2
Responsible rules
RestoreDefaultNullToNullableTypePropertyRectorExpected Behavior