How can I tell PhpStorm 8.0.3 to keep the following array as it is when clicking Cmd+Alt+L
to reformat my code:
$array = array(
'short' => 1, // I want this...
'veryVeryVeryIncrediblyLong' => 123456789,
);
Instead of doing this:
$array = array(
'short' => 1, // Not this...
'veryVeryVeryIncrediblyLong' => 123456789,
);
I don't want it to be aligned, because even though generally speaking it is very good, sometimes it doesn't work - such as in huge config arrays, or just to avoid having longer diffs if you have to re-align a full array after adding a new key...
Preferences → Editor → Code Style → PHP → Other → Align key-value pairs
Settings (Preferences on Mac) | Editor | Code Style | PHP | Other | Array declaration style -> Align key-value pairs
In Phpstorm 2017.3 & later , This setting is located at File | Settings | Editor | Code Style | PHP | Wrapping and Braces | Array initializer | Align key-value pairs