# 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/50e42109-9747-458b-bbad-cf105d3dc1d3 ```php <?php class Test { public $a; public function __construct(string $a = null) { $this->a = $a; } } ``` ### Responsible rules * `ClassPropertyAssignToConstructorPromotionRector` ## Expected Behavior <!-- How should Rector change the code? Or should Rector skip it? --> either skip it or make the string type nullable so it not causing an error
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.com/demo/50e42109-9747-458b-bbad-cf105d3dc1d3
Responsible rules
ClassPropertyAssignToConstructorPromotionRectorExpected Behavior
either skip it or make the string type nullable so it not causing an error