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

Recognizes optional syntax by its grammar owner rather than neighboring words.

Methods§

public function __construct(
    private array<string, list<list<string>>> $defaults,
    private list<string> $joins,
    private array<string, string> $distinctParents,
    private ?string $selectOptions = null,
    private ?string $strictJoin = null,
)

Parameters

$defaultsarray<string, list<list<string>>>Optional spellings by grammar rule
$joinslist<string>Grammar rules that own join modifiers
$distinctParentsarray<string, string>Distinct quantifiers eligible under a parent
$selectOptions?string
$strictJoin?string
public function apply(Node $node, list<Token> $tokens, ?Node $parent): list<Token>

Removes defaults only from the rules in which omission has the same meaning.

Parameters

$nodeNode
$tokenslist<Token>
$parent?Node

Returns

list<Token>
Calls 8
public function default(string $rule, list<string> $words, ?Node $parent): bool

Parameters

$rulestring
$wordslist<string>
$parent?Node

Returns

bool
Called from 1
Calls 1

Private surface 5§

Implementation details, listed for orientation only.

private array<string, list<list<string>>> $defaults
private list<string> $joins
private array<string, string> $distinctParents
private ?string $selectOptions = null
private ?string $strictJoin = null

Test cases 17§

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 16

Relations§

Instantiated in 3
Type declarations 1