# Bug Report <!-- First, thank you for reporting a bug. That takes time and we appreciate that! --> | Subject | Details | | :------------- | :---------------------------------------------------------------| | Rector version: [0f0b93](https://github.com/rectorphp/rector-src/commit/0f0b93) - released at 2023-03-27 15:06 | <!-- Please describe your problem here. --> ## Minimal PHP Code Causing Issue https://getrector.com/demo/674bc158-9f21-481b-9c78-4ed12915a9f8 ```php final class DemoFile { private string $env; public function __construct(bool $sandbox) { if ($sandbox) { $this->env = 'sandbox'; } else { $this->env = 'prod'; } } } ``` ## Expected Behaviour The `$env` property should be marked as readonly