Skip to content

Space concat operator inside PHP attributes in blink ConcatSpace - #240

Merged
TomasVotruba merged 1 commit into
mainfrom
blink-concat-space-attribute
Oct 30, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
blink-concat-space-attribute

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

blink lexes an entire #[...] attribute as a single opaque Comment token, so
token-walking fixers never see the . concat operator inside. ConcatSpace
therefore left attribute concatenations unchanged while PHP ECS spaces them.

This mirrors the existing collapseAttributeArrowSpacing precedent in
binary_operator_spaces.go: after the normal token pass, rewrite the attribute
token text to force a single space around each top-level . (spacing: one) or
remove it (spacing: none).

The char scan skips dots inside quoted strings, ... spreads and float
literals (1.5, .5, 1.), and none mode keeps a space that guards a number.

Fixes laravel parity for tests/Foundation/FoundationDocsCommandTest.php and
tests/Integration/Foundation/Console/AboutCommandTest.php.

@TomasVotruba
TomasVotruba merged commit 878a5a9 into main Oct 30, 2026
20 of 21 checks passed
@TomasVotruba
TomasVotruba deleted the blink-concat-space-attribute branch October 30, 2026 16:40
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