如果签名长于定义的行长度,如何修复 PhpStorm (2020.1.2) 中的函数声明格式?
How to fix function declaration formatting in PhpStorm (2020.1.2) if signature longer then defined row length?
例如我有这样的函数声明:
public function someLongMethodWithLongParamName(int $longparamName): VeryLongReturnValueType {}
行长度限制小于函数签名的字符数。
如果我输入 Ctrl + Alt + L
PhpStorm 将格式化这一行,但方式很奇怪:
public function someLongMethodWithLongParamName(int $longparamName
): VeryLongReturnValueType {
}
(PhpStorm 在方法名称行中留下了参数)。如果我再添加一个参数,PhpStorm 将正确格式化行:
public function someLongMethodWithLongParamName(
int $longparamName,
bool $flag
): VeryLongReturnValueType {
}
也许有人处理过这样的错误?
P.S。这是我的代码风格设置:
您似乎还希望它包装参数及其类型?然后从屏幕截图中删除 Method declaration parameters
设置中的 Place ')' on new line
复选框。
例如我有这样的函数声明:
public function someLongMethodWithLongParamName(int $longparamName): VeryLongReturnValueType {}
行长度限制小于函数签名的字符数。
如果我输入 Ctrl + Alt + L
PhpStorm 将格式化这一行,但方式很奇怪:
public function someLongMethodWithLongParamName(int $longparamName
): VeryLongReturnValueType {
}
(PhpStorm 在方法名称行中留下了参数)。如果我再添加一个参数,PhpStorm 将正确格式化行:
public function someLongMethodWithLongParamName(
int $longparamName,
bool $flag
): VeryLongReturnValueType {
}
也许有人处理过这样的错误?
P.S。这是我的代码风格设置:
您似乎还希望它包装参数及其类型?然后从屏幕截图中删除 Method declaration parameters
设置中的 Place ')' on new line
复选框。