phpStorm代码格式化tip

1、函数方法类等花括号与声明在同一行

在setting -> editor -> code style -> PHP -> Wrapping and Braces -> Braces placement
In function declaration 选择End of line

phpStorm代码格式化tip

phpStorm代码格式化tip

数组保持分行(原样)

在setting -> editor -> code style -> PHP -> Wrapping and Braces -> Keep when reformatting
Line breaks 勾选后保持原有的断行,下图的数组格式化后不会变成一行
Comment at first column 勾选后注释行不缩进
Control statement in one line ?不知道
Simple methods in one line 简单的函数、方法变成一行

phpStorm代码格式化tip

phpStorm代码格式化tip

函数注释

phpStorm代码格式化tip