Blink parity: semicolon, bracket-comment, float, destructuring - #130
Merged
Merged
Conversation
php-cs-fixer's SpaceAfterSemicolon inserts a space after a ";" that is followed by another ";" (the empty condition of a for() header), only suppressing it before ")". NoSinglelineWhitespaceBeforeSemicolons must then leave that space alone when the preceding token is itself a ";".
SpacesInsideParentheses and TrimArraySpaces removed the single-line space
next to a comment ("if ( // note", "[ // note"); php-cs-fixer leaves it,
so guard both against an adjacent comment token.
PHP's context-free scanner matches ".1" as a single DNUMBER; blink split it into "." and "1", so a concat-spacing rule turned "+ .1" into "+ . 1".
php-cs-fixer tags "[$a,$b] = ..." as destructuring, not an array, so WhitespaceAfterCommaInArray leaves its commas alone. Track a destructuring "[" (matching "]" followed by "=", or nested in one) on the bracket stack.
TomasVotruba
force-pushed
the
tv-blink-parity-small-buckets
branch
from
October 4, 2026 05:54
031232b to
ecadd95
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four isolated blink parity fixes on mautic/mautic, each verified against the PHP engine with no regression. Measured drop: 72 to 65 differing files of 4527.
Empty for condition spacing
SpaceAfterSemicolonnow inserts a space after a;that is followed by another;(the empty condition of afor()header), suppressing it only before).NoSinglelineWhitespaceBeforeSemicolonskeeps that space when the preceding token is itself a;. Matches php-cs-fixerfor ($i = 0; ; ++$i).Space before a trailing comment
SpacesInsideParenthesesandTrimArraySpaceskept removing the single-line space between a bracket and a comment (if ( // note,[ // note). php-cs-fixer leaves it, so both now skip an adjacent comment token.Leading-dot float
The lexer now reads
.1as oneDNUMBER, mirroring PHP's context-free scanner. It was split into.and1, so a concat-spacing rule turned+ .1into+ . 1.Destructuring commas
php-cs-fixer tags
[$a,$b] = ...as destructuring, not an array, soWhitespaceAfterCommaInArrayleaves its commas alone. The bracket stack now marks a destructuring[(matching]followed by=, or nested in one).