phpphp-cs-fixer

Associative array align => with PHP-CS-Fixer


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


Solution

  • For PHP-CS-Fixer v1, it used to be the option: align_double_arrow

    For newer versions, check the other answer.