New PHP Fixers
March 05, 2020
We have made some changes to our PHP fixing platform today, mostly to allow us to improve PSR12 support.
- We have renamed our
braces
fixer topsr12_braces
and we have tweaked it so that single-line closure syntax is now permitted. You can still enable/disable this fixer using its old name, for now. In light of this change, we have introduced a new fixerpsr2_braces
, which behaves just like thepsr12_braces
fixer, but insists on closures having PSR2 style braces. Thepsr12_braces
andpsr2_braces
fixers cannot both be enabled at the same time - enable one or the other, or neither. - We have added a new
method_argument_space_strict
fixer which behaves just like our existingmethod_argument_space
fixer, but additionally enforces that if parameters span more than one line, each must be on its own line, in accordence with PSR12. Themethod_argument_space
andmethod_argument_space_strict
fixers cannot both be enabled at the same time - enable one or the other, or neither. - We have now marked the
no_unneeded_final_method
fixer as risky, due its behaviour on private final methods that are overriting methods in a parent class.
Our presets have thus changed in the following way:
- Our
none
preset remains the same. It enables no rules. - Our
psr1
preset remains the same. It enables the same three rules as previously. - Our
psr2
preset has been updated. We have removed thebraces
fixer and added thepsr2_braces
fixer. - Our
psr12
preset has been updated. We have removed thebraces
andmethod_argument_space
fixers and added theconcat_with_spaces
,method_argument_space_strict
, andpsr12_braces
fixers. - Our
symfony
preset has been updated. We have removed thebraces
andmethod_argument_space
fixers and added themethod_argument_space_strict
andpsr12_braces
fixers. - Our
laravel
preset has been updated. We have removed thebraces
fixer and added thepsr2_braces
fixer. - Our
recommended
preset has been updated. We have removed thebraces
andmethod_argument_space
fixers and added themethod_argument_space_strict
andpsr12_braces
fixers.
Please do get in touch with us if you have any questions or comments!