classQuotedDomain
final class QuotedDomain
implements ValueDomain
One quoted scanner state: delimiter, optional prefix, doubling and optional backslash escapes.
Methods§
public function __construct(
private string $quote,
private non-empty-list<string> $prefixes = [''],
private bool $backslash = false,
private int $minimum = 0,
private int $maximum = 255,
private non-empty-list<non-empty-string> $alphabet = ['a', 'Z', '0', ' ', "'", '"', '`', '\\', 'é', '猫'],
private ?string $closing = null,
private bool $trailingSpace = true,
private bool $unicodeEscapes = false,
)Parameters
$quote | string | |
$prefixes | non-empty-list<string> | |
$backslash | bool | |
$minimum | int | |
$maximum | int | |
$alphabet | non-empty-list<non-empty-string> | Unencoded characters sampled as complete atoms |
$closing | ?string | |
$trailingSpace | bool | |
$unicodeEscapes | bool |
Test cases 10
QuotedDomainTest::testChooseClosesWithTheDistinctClosingDelimiterWhenOneIsDeclaredcoversQuotedDomainTest::testChooseEscapesDelimitersBackslashesAndUnicodeEscapeMarkersDuringConstructioncoversQuotedDomainTest::testChooseKeepsATrailingSpaceUnlessTheScannerTrimsItcoversQuotedDomainTest::testChooseSpansTheDefaultBodyLengthsFromEmptyToTheScannerMaximumcoversQuotedDomainTest::testEncodeLeavesBackslashesAloneUnlessTheScannerReadsEscapescoversQuotedDomainTest::testEncodeReturnsCompleteEscapedAtomscoversQuotedDomainTest::testEndReadsTheContentAfterAnOpeningDelimitercoversQuotedDomainTest::testEndRequiresTheMinimumBodyLengthcoversQuotedDomainTest::testMatchReadsEveryDeclaredPrefixInTurncoversQuotedDomainTest::testMatchStopsAtTheFirstUnescapedClosingDelimitercovers
public function choose(Closure(positive-int): int $choose): stringParameters
$choose | Closure(positive-int): int |
Returns
stringTest cases 4
QuotedDomainTest::testChooseClosesWithTheDistinctClosingDelimiterWhenOneIsDeclaredcovers and callsQuotedDomainTest::testChooseEscapesDelimitersBackslashesAndUnicodeEscapeMarkersDuringConstructioncovers and callsQuotedDomainTest::testChooseKeepsATrailingSpaceUnlessTheScannerTrimsItcovers and callsQuotedDomainTest::testChooseSpansTheDefaultBodyLengthsFromEmptyToTheScannerMaximumcovers and calls
public function encode(string $atom): stringEncodes one complete character while constructing the value.
Parameters
$atom | string |
Returns
stringTest cases 6
QuotedDomainTest::testChooseClosesWithTheDistinctClosingDelimiterWhenOneIsDeclaredcoversQuotedDomainTest::testChooseEscapesDelimitersBackslashesAndUnicodeEscapeMarkersDuringConstructioncoversQuotedDomainTest::testChooseKeepsATrailingSpaceUnlessTheScannerTrimsItcoversQuotedDomainTest::testChooseSpansTheDefaultBodyLengthsFromEmptyToTheScannerMaximumcoversQuotedDomainTest::testEncodeLeavesBackslashesAloneUnlessTheScannerReadsEscapescovers and callsQuotedDomainTest::testEncodeReturnsCompleteEscapedAtomscovers and calls
public function match(string $value, int $offset = 0): list<int>Parameters
$value | string | |
$offset | int |
Returns
list<int>Test cases 2
QuotedDomainTest::testMatchReadsEveryDeclaredPrefixInTurncovers and callsQuotedDomainTest::testMatchStopsAtTheFirstUnescapedClosingDelimitercovers and calls
public function end(string $value, int $offset): ?intReads one scanner state until its first unescaped closing delimiter.
Parameters
$value | string | |
$offset | int |
Returns
?intTest cases 4
Private surface 9§
Implementation details, listed for orientation only.
private string $quoteprivate non-empty-list<string> $prefixes = ['']private bool $backslash = falseprivate int $minimum = 0private int $maximum = 255private non-empty-list<non-empty-string> $alphabet = ['a', 'Z', '0', ' ', "'", '"', '`', '\\', 'é', '猫']private ?string $closing = nullprivate bool $trailingSpace = trueprivate bool $unicodeEscapes = falseTest cases 16§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 10
QuotedDomainTest::testChooseClosesWithTheDistinctClosingDelimiterWhenOneIsDeclaredcovers and callsQuotedDomainTest::testChooseEscapesDelimitersBackslashesAndUnicodeEscapeMarkersDuringConstructioncovers and callsQuotedDomainTest::testChooseKeepsATrailingSpaceUnlessTheScannerTrimsItcovers and callsQuotedDomainTest::testChooseSpansTheDefaultBodyLengthsFromEmptyToTheScannerMaximumcovers and callsQuotedDomainTest::testEncodeLeavesBackslashesAloneUnlessTheScannerReadsEscapescovers and callsQuotedDomainTest::testEncodeReturnsCompleteEscapedAtomscovers and callsQuotedDomainTest::testEndReadsTheContentAfterAnOpeningDelimitercovers and callsQuotedDomainTest::testEndRequiresTheMinimumBodyLengthcovers and callsQuotedDomainTest::testMatchReadsEveryDeclaredPrefixInTurncovers and callsQuotedDomainTest::testMatchStopsAtTheFirstUnescapedClosingDelimitercovers and calls
Other tests reaching this symbol 6
LexicalExceptionTestcallsGenerationContextTestcallsDefinitionFactoryTestcallsLexicalGrammarTestcallsPostgreSqlProviderTestcallsSqlGeneratorFactoryTestcalls
Relations§
Instantiated in 5
- new SqlFaker\PostgreSql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/PostgreSql/Generation/Lexeme/DefinitionFactory.php:570
- new SqlFaker\PostgreSql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/PostgreSql/Generation/Lexeme/DefinitionFactory.php:582
- new SqlFaker\PostgreSql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/PostgreSql/Generation/Lexeme/DefinitionFactory.php:624
- new SqlFaker\PostgreSql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/PostgreSql/Generation/Lexeme/DefinitionFactory.php:638
- new SqlFaker\PostgreSql\Generation\Lexeme\DefinitionFactory::create() packages/sql-faker/src/PostgreSql/Generation/Lexeme/DefinitionFactory.php:687