例如,我已经开始使用PHP-CS-Fixer了,我想知道是否有任何配置不能在行内语句中自动添加大括号
//I want to keep this way
if (empty($var))
throw new Exception('An error message..')
但是当我格式化时会变成这样:
if (empty($var)) {
throw new Exception('An error message..')
}
我的php_cs.dist配置:
...
->setRules([
'no_unneeded_curly_braces' => true,
'braces' => [
'allow_single_line_closure' => true,
'position_after_functions_and_oop_constructs' => 'same'
]
])
...
使用PHP-CS-Fixer是否可以实现?