Bug Report
| Subject |
Details |
| Rector version |
last dev-main |
Rector\Php81\Rector\Property\ReadOnlyPropertyRector will apply to hooks defined in constructor params
<?php
final class SkipParamHook
{
- public function __construct(private string $foo {
+ public function __construct(private readonly string $foo {
get {
return $this->foo;
}
But this is not valid as properties with hooks cannot have readonly property
for properties in general it was fixed already #9040
Minimal PHP Code Causing Issue
PHP 8.1
https://getrector.com/demo/018ac6a4-069c-411d-b7be-da07dc31841b
Expected Behaviour
rector skips rule if constructor param has hooks
See rectorphp/rector-src#7192