classSpacing
final class Spacing
Restricted visibility: declared "@visibility SqlFormatter". Code outside that scope must not name this declaration.
Uses the configured lexer to distinguish required separators from layout whitespace.
Methods§
public function __construct(private SqlParser $parser, private Settings $settings)Reuses the caller's grammar release and lexical SQL mode.
Parameters
$parser | SqlParser | |
$settings | Settings |
public function between(Token $left, Token $right, ?Token $next, ?Token $before = null): stringIncludes lookahead when comparing candidate token boundaries.
Parameters
$left | Token | |
$right | Token | |
$next | ?Token | |
$before | ?Token |
Returns
stringTest cases 3
Called from 1
Calls 1
- method-call Spacing::signature() line 36
public function signature(string $sql): list<array{string, string}>Parameters
$sql | string |
Returns
list<array{string, string}>Throws
SourceException When a candidate joins tokens into an invalid lexemeTest cases 1
Called from 2
Calls 2
- function-call
array_mapline 56 - method-call SqlParser::tokenize() line 56
Private surface 2§
Implementation details, listed for orientation only.
private SqlParser $parserprivate Settings $settingsTest cases 18§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Other tests reaching this symbol 15
DocumentTestcallsGroupingTestcallsKeywordsTestcallsReductionsTestcallsRendererTestcallsRulesTestcallsSettingsTest::testInjectedSeparatorPrecedesLexerProbingcallsShapeTestcallsTriviaTestcallsVisitorTestcallsFormatterTestcallsFormatterTestcallsDialectTestcallsDialectTestcallsDialectTestcalls