选项“align_double_arrow”、“align_equals”不存在。定义的选项有:“默认”、“运算符”

Rus*_*tam 3 php php-cs-fixer

在我的 php-cs-fixer.php 中我有这一行:

'binary_operator_spaces' => ['align_equals' => false, 'align_double_arrow' => true],
Run Code Online (Sandbox Code Playgroud)

它给了我一个错误:

The options "align_double_arrow", "align_equals" do not exist. Defined options are: "default", "operators". 
Run Code Online (Sandbox Code Playgroud)

你能帮助我们operators and default实现同样的目标吗?

gre*_*las 6

根据升级指南,您应该operators为每个运营商选择所需的策略。

因此,在您的情况下,配置将如下所示:

'binary_operator_spaces' => [
    'operators' => [
        '=' => 'no_space',
        '=>' => 'align',
    ]
]
Run Code Online (Sandbox Code Playgroud)

有关更多信息,请查看文档中的binary_operator_spaces规则。