final class LexicalDelimiters

Refuses lexical data a scanner could not use.

An empty delimiter matches at every position without consuming anything, so a scanner given one would never move on. Refusing it where the profile is built means the scanner can take every delimiter it is handed as something it can actually advance past.

Methods§

public function pairs(
    array<string, string> $pairs,
    string $kind,
): array<non-empty-string, non-empty-string>

Answers the opening-to-closing pairs, having refused any empty end.

Parameters

$pairsarray<string, string>Opening delimiter => the one that closes it
$kindstringWhat the pairs delimit, for the refusal

Returns

array<non-empty-string, non-empty-string> The same pairs

Throws

InvalidDefinitionException When either end of a pair is empty
Test cases 2
Called from 3
Calls 1
public function perPrefixLists(array<string, list<string>> $parameters): array<non-empty-string, list<non-empty-string>>

Answers the per-prefix lists, having refused any empty prefix or entry.

Parameters

$parametersarray<string, list<string>>Parameter prefix => delimiters that may follow it

Returns

array<non-empty-string, list<non-empty-string>> The same lists

Throws

InvalidDefinitionException When a prefix or one of its entries is empty
Test cases 1
Called from 2
Calls 2
public function perPrefixPatterns(array<string, string> $patterns): array<non-empty-string, non-empty-string>

Answers the per-prefix patterns, having refused any preg cannot read.

Parameters

$patternsarray<string, string>Parameter prefix => pattern for what may follow its name

Returns

array<non-empty-string, non-empty-string> The same patterns

Throws

InvalidDefinitionException When a prefix is empty or a pattern is unreadable
Test cases 1
Called from 1
Calls 2
public function validPatterns(list<string> $patterns): list<non-empty-string>

Answers the patterns, having refused any preg cannot read.

Parameters

$patternslist<string>Patterns as the dialect declared them

Returns

list<non-empty-string> The same patterns

Throws

InvalidDefinitionException When one of them is empty or unreadable
Test cases 1
Called from 1
Calls 2

Private surface 1§

Implementation details, listed for orientation only.

private LexicalPattern $patterns = new \ZtdQuery\Sql\LexicalPattern()

Test cases 19§

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

Dedicated tests 6
Other tests reaching this symbol 13

Relations§

Instantiated in 3
Method calls 10
Type declarations 3