You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(formatter): align binary operator formatting with PER standard
This commit updates the default formatting for binary operators to align with the PER Coding Style standard and fixes
several related indentation bugs that this change revealed.
The default value for `line_before_binary_operator` has now been set to `true`. This enforces the modern style where the
operator is placed at the beginning of the new line in multi-line expressions.
```php
// Old Default
if (
$longName &&
$anotherLongName
) {
// ...
}
// New Default
if (
$longName
&& $anotherLongName
) {
// ...
}
````
Changing this default uncovered issues where the formatter would apply an extra, incorrect level of indentation to the
line containing the operator. The logic has been corrected to remove this extra indent, ensuring that chained conditions
in conditions, assignments, and return statements are formatted cleanly and according to the PER standard.
Signed-off-by: azjezz <[email protected]>
0 commit comments