选项 "align_double_arrow"、"align_equals" 不存在。定义的选项是:"default"、"operators"

The options "align_double_arrow", "align_equals" do not exist. Defined options are: "default", "operators"

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

'binary_operator_spaces' => ['align_equals' => false, 'align_double_arrow' => true],

它给我一个错误提示:

The options "align_double_arrow", "align_equals" do not exist. Defined options are: "default", "operators". 

你能帮助使用 operators and default 来实现同样的目标吗?

根据upgrade guide,您应该使用operators为每个运算符选择所需的策略。

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

'binary_operator_spaces' => [
    'operators' => [
        '=' => 'no_space',
        '=>' => 'align',
    ]
]

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