Should associative array => should be align with PHP-CS-Fixer ?
$array = [
1 => 'a',
'1' => 'b',
1.5 => 'c',
true => 'd',
];
or
$array = [
1 => 'a',
'1' => 'b',
1.5 => 'c',
true => 'd',
];
I didn't find filter for that in https://github.com/FriendsOfPHP/PHP-CS-Fixer
This is now a proper way to run the align_double_arrow
with newer versions of PHP-CS-Fixer (v2, v3), which will align array elements after the double arrow ('=>'):
php-cs-fixer fix path \
--rules='{"binary_operator_spaces": {"operators": {"=>": "align_single_space_minimal"}}}'
More to read: https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/3.0/doc/rules/operator/binary_operator_spaces.rst
Filter for that is align_double_arrow
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With