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

Renders and verifies compact SQL using a dialect-specific canonical token stream.

Methods§

public function __construct(private SqlParser $parser, private Settings $settings)

Shares the caller's parser for lexical decisions and output verification.

Parameters

$parserSqlParser
$settingsSettings
Calls 1
public function render(Node $tree): string

Removes optional syntax, then reparses to check the canonical form.

Parameters

$treeNode

Returns

string

Throws

FormattingException When output verification fails
Test cases 3
Called from 1
Calls 7
public function write(list<Token> $tokens, string $trailing): string

Emits a canonical stream with only lexically necessary separators.

Parameters

$tokenslist<Token>
$trailingstring

Returns

string
Test cases 1
Called from 2
Calls 2

Private surface 4§

Implementation details, listed for orientation only.

private array<string, string> $separators = []
private Spacing $spacing
private SqlParser $parser
private Settings $settings

Test cases 20§

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

Dedicated tests 5
Other tests reaching this symbol 15

Relations§

Instantiated in 1
Method calls 1