[binary_operator_spaces] Invalid configuration
stebogit opened this issue · comments
- Pint Version: 1.2.1
- PHP Version: 8.0.25
I'm getting this error running ./vendor/bin/pint
:
In AbstractFixer.php line 152:
[binary_operator_spaces] Invalid configuration: Unexpected "operators" key, expected any of "=", "*", "/", "%", "<", ">", "|", "^", "+", "-", "&", "&=", "&&", "||", ".=", "/=", "=>", "==", ">=", "===", "!=", "<>", "!==", "<=", "and", "or", "xor", "-=", "%=", "*=", "|=", "+=", "<<", "<<=", ">>", ">>=", "^=", "**", "**=", "<=>", "??
", "??=", got "string#!".
In BinaryOperatorSpacesFixer.php line 316:
Unexpected "operators" key, expected any of "=", "*", "/", "%", "<", ">", "|", "^", "+", "-", "&", "&=", "&&", "||", ".=", "/=", "=>", "==", ">=", "===", "!=", "<>", "!==", "<=", "and", "or", "xor", "-=", "%=", "*=", "|=", "+=", "<<", "<<=", ">>", ">>=", "^=", "**", "**=", "<=>", "??", "??=", got "string#!".
What's wrong with my binary_operator_spaces
definition? I believe it is correct.
{
"preset": "laravel",
"rules": {
"binary_operator_spaces": {
"default": "single_space",
"operators": {
"=>": "align_single_space_minimal",
"|": "no_space",
"!": "no_space"
}
},
"function_declaration": {
"closure_function_spacing": "none"
},
"cast_spaces": {
"space": "none"
},
"blank_line_before_statement": {
"statements": [
"try",
"declare"
]
},
"not_operator_with_space": false,
"unary_operator_spaces": false,
"not_operator_with_successor_space": false
},
}
"!"
is not a valid value for operators. See the list of valid ones: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v3.11.0/doc/rules/operator/binary_operator_spaces.rst#operators