自动格式化/对齐阵列PhpStorm

Ken*_*zos 0 php arrays phpstorm

我正在使用Ubuntu.

如何在单击Ctrl + Alt + Shift + L重新格式化代码时告诉PhpStorm 2017.3保留以下数组:

<?php
return [

'page_not_found' => 'Page not Found',
'message_required' => 'Please enter your message',
];
Run Code Online (Sandbox Code Playgroud)

对此

<?php
return [

'page_not_found'   => 'Page not Found',
'message_required' => 'Please enter your message',
];
Run Code Online (Sandbox Code Playgroud)

ore*_*pot 5

目前我正在回答关于PHP设置的问题(它与其他语言类似).

1)打开PHP Storm

2)转到设置

3)找到editor tab> Code style>PHP

4)现在你会找到选项"Wrapping and braces"(第3个标签)

5)现在在该选项卡的最后3个选项中你会找到 Array Initializer(选择前2个选项.结帐截图)截图