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
bracesfixer topsr12_bracesand 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_bracesfixer, but insists on closures having PSR2 style braces. Thepsr12_bracesandpsr2_bracesfixers cannot both be enabled at the same time - enable one or the other, or neither. - We have added a new
method_argument_space_strictfixer which behaves just like our existingmethod_argument_spacefixer, but additionally enforces that if parameters span more than one line, each must be on its own line, in accordence with PSR12. Themethod_argument_spaceandmethod_argument_space_strictfixers cannot both be enabled at the same time - enable one or the other, or neither. - We have now marked the
no_unneeded_final_methodfixer 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
nonepreset remains the same. It enables no rules. - Our
psr1preset remains the same. It enables the same three rules as previously. - Our
psr2preset has been updated. We have removed thebracesfixer and added thepsr2_bracesfixer. - Our
psr12preset has been updated. We have removed thebracesandmethod_argument_spacefixers and added theconcat_with_spaces,method_argument_space_strict, andpsr12_bracesfixers. - Our
symfonypreset has been updated. We have removed thebracesandmethod_argument_spacefixers and added themethod_argument_space_strictandpsr12_bracesfixers. - Our
laravelpreset has been updated. We have removed thebracesfixer and added thepsr2_bracesfixer. - Our
recommendedpreset has been updated. We have removed thebracesandmethod_argument_spacefixers and added themethod_argument_space_strictandpsr12_bracesfixers.
Please do get in touch with us if you have any questions or comments!