You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The property anotherClass can't be read only, because read only properties can't have a default value.
With the refactored code, you will get a Fatal error: Readonly property SomeClass::$anotherClass cannot have default value exception: https://3v4l.org/Ke5Jc
The text was updated successfully, but these errors were encountered:
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.org/demo/1f0af0d6-cd51-4f66-a14d-8e5b3e1797f6
Responsible rules
ReadOnlyPropertyRector
MakeTypedPropertyNullableIfCheckedRector
Expected Behavior
The property
anotherClass
can't be read only, because read only properties can't have a default value.With the refactored code, you will get a
Fatal error: Readonly property SomeClass::$anotherClass cannot have default value
exception: https://3v4l.org/Ke5JcThe text was updated successfully, but these errors were encountered: