Skip to content

Space compound assignment operators by default in blink BinaryOperatorSpaces - #239

Merged
TomasVotruba merged 1 commit into
mainfrom
blink-compound-assignment-spacing
Oct 30, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
blink-compound-assignment-spacing

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Compound assignment operators (.=, +=, -=, *=, ...) are always binary and never unary, so PHP-CS-Fixer's BinaryOperatorSpacesFixer spaces them under the default mode, like plain =.

blink treated them as extra operators that only got spaced when explicitly listed in the operators option. So code like $x .='c' kept its missing space and diverged from PHP ECS.

This moves the compound assignment family into the default target set; arithmetic operators that can be unary (+, -, *, &, |) stay guarded as before. Verified against the real laravel files; added default-spacing regression cases.

…rSpaces

Compound assignment operators (.=, +=, -=, *=, etc.) are always binary and
never unary, so PHP-CS-Fixer's BinaryOperatorSpaces spaces them under the
default mode like plain =. blink treated them as extra operators that only got
spaced when explicitly listed in the operators option, so code like $x .='c'
kept its missing space and diverged from ECS.

Move the compound assignment family into the default target set; arithmetic
operators that can be unary stay guarded. Resolves the .= laravel parity
divergences (ServeFileTest, BladeCompiler).
@TomasVotruba
TomasVotruba force-pushed the blink-compound-assignment-spacing branch from 604de7c to 2ba6d3e Compare October 30, 2026 16:39
@TomasVotruba
TomasVotruba enabled auto-merge (squash) October 30, 2026 16:39
@TomasVotruba
TomasVotruba disabled auto-merge October 30, 2026 16:39
@TomasVotruba
TomasVotruba merged commit becbb58 into main Oct 30, 2026
21 checks passed
@TomasVotruba
TomasVotruba deleted the blink-compound-assignment-spacing branch October 30, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant