Bug Report
A property with a redundant default value does not get "readonly" treatment.
as soon as I remove = null default from the property, the "readonly" is properly added, see https://getrector.com/demo/3648f53a-26e7-422d-9d24-57cd6c85ba5a
(the = null is redundant, because the property is always overwritten in __construct)
Minimal PHP Code Causing Issue
https://getrector.com/demo/31124e18-e32b-41b3-8f12-87538e524872
Expected Behaviour
I am not sure its a bug in ReadOnlyPropertyRector. maybe rector should remove the redundant =null itself, so the other rules will start working as expected
Bug Report
A property with a redundant default value does not get "readonly" treatment.
as soon as I remove
= nulldefault from the property, the "readonly" is properly added, see https://getrector.com/demo/3648f53a-26e7-422d-9d24-57cd6c85ba5a(the
= nullis redundant, because the property is always overwritten in__construct)Minimal PHP Code Causing Issue
https://getrector.com/demo/31124e18-e32b-41b3-8f12-87538e524872
Expected Behaviour
I am not sure its a bug in ReadOnlyPropertyRector. maybe rector should remove the redundant
=nullitself, so the other rules will start working as expected