final class Shape
Restricted visibility: declared "@visibility SqlFormatter". Code outside that scope must not name this declaration.

Compares canonical syntax while retaining operand nesting and operator association.

Methods§

public function __construct(
    private array<int, Token> $tokens,
    private array<int, true> $grouping,
)

Parameters

$tokensarray<int, Token>Canonical tokens indexed by original offset
$groupingarray<int, true>Expression parentheses excluded from the shape
public function of(Node|Token $node): ?string

Collapses empty and single-child grammar wrappers, but preserves branching.

Parameters

$nodeNode|Token

Returns

?string
Test cases 1
Called from 2
Calls 4

Private surface 2§

Implementation details, listed for orientation only.

private array<int, Token> $tokens
private array<int, true> $grouping

Test cases 16§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 15

Relations§

Instantiated in 1
Method calls 1