Bug Report
| Subject |
Details |
| Rector version |
e.g. dev-main (invoke vendor/bin/rector --version) |
Minimal PHP Code Causing Issue
Reproduced on PHP 8.4:
https://getrector.com/demo/b1c3546d-96ff-43c0-8182-c58093d6ddb1
Given the following code:
final class DemoFile
{
protected final $x = true;
}
which valid on PHP 8.4 https://3v4l.org/gXaQt#v8.4.25
changed to:
final class DemoFile
{
- protected final $x = true;
+ final private $x = true;
}
and cause error:
Fatal error: Property cannot be both final and private
Ref https://3v4l.org/lhT8c#v8.4.25
Expected Behaviour
The final should be removed on private modifier, so should be:
final class DemoFile
{
- protected final $x = true;
+ private $x = true;
}
Bug Report
vendor/bin/rector --version)Minimal PHP Code Causing Issue
Reproduced on PHP 8.4:
https://getrector.com/demo/b1c3546d-96ff-43c0-8182-c58093d6ddb1
Given the following code:
which valid on PHP 8.4 https://3v4l.org/gXaQt#v8.4.25
changed to:
final class DemoFile { - protected final $x = true; + final private $x = true; }and cause error:
Ref https://3v4l.org/lhT8c#v8.4.25
Expected Behaviour
The
finalshould be removed onprivatemodifier, so should be:final class DemoFile { - protected final $x = true; + private $x = true; }