nullable_type_declaration_for_default_null_value
should not fix readonly constructor promoted properties if set to false
#6239
Labels
Bug report
Rule
'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => false]
Description
Latest version 3.5 "fixes" readonly promoted properties with the given rule.
Rule should not touch the code like with non-readonly promoted properties.
Code snippet that reproduces the problem
Diff output
Possible fix
Add check for
T_READONLY
https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/333f15e07c866e33e2765e84ba1e0b88e6a3af3b/src/Fixer/FunctionNotation/NullableTypeDeclarationForDefaultNullValueFixer.php#L139-L152
The text was updated successfully, but these errors were encountered: