PhpStorm - 将方法大括号样式与 PSR-2 点 4.4 集成
PhpStorm - integrate method braces style with PSR-2 point 4.4
如何强制执行(在 PhpStorm 中)方法代码样式 this:
class ClassName
{
public function foo($arg1, &$arg2, $arg3 = [])
{
// method body
}
public function aVeryLongMethodName(
ClassTypeHint $arg1,
&$arg2,
array $arg3 = []
) {
// method body
}
}
同时拥有
"Braces placement" => "In function declaration" => "Next line"
在 aVeryLongMethodName()
方法案例中,大括号 {
属于 )
。
正如@LazyOne 在评论中提到的,使用预定义样式就是我所需要的一切。
此处提供选项:
然后:"Predefined style" => "PSR1/PSR2"
如何强制执行(在 PhpStorm 中)方法代码样式 this:
class ClassName
{
public function foo($arg1, &$arg2, $arg3 = [])
{
// method body
}
public function aVeryLongMethodName(
ClassTypeHint $arg1,
&$arg2,
array $arg3 = []
) {
// method body
}
}
同时拥有
"Braces placement" => "In function declaration" => "Next line"
在 aVeryLongMethodName()
方法案例中,大括号 {
属于 )
。
正如@LazyOne 在评论中提到的,使用预定义样式就是我所需要的一切。
此处提供选项:
然后:"Predefined style" => "PSR1/PSR2"