classCharsetLexemeGenerator
final class CharsetLexemeGenerator
implements LexemeGenerator
sql_yacc.yy literal actions require introduced bytes to be well formed in the selected character set.
Methods§
public function generate(LexemeInput $input): ?LexemeCandidatesFilters a finite declared charset domain against the already resolved right-hand literal.
Parameters
$input | LexemeInput |
Returns
Test cases 1
Calls 6
- new ValueLexemeGenerator line 29
- new WordDomain line 29
- method-call ValueLexemeGenerator::generate() line 30
- method-call CharsetLexemeGenerator::bytes() line 34
- method-call CharsetLexemeGenerator::accepts() line 37
- static-call LexemeCandidates::of() line 41
public function bytes(string $literal): stringDecodes complete binary literal forms; text-literal quoting consists only of ASCII bytes.
Parameters
$literal | string |
Returns
stringTest cases 10
CharsetLexemeGeneratorTest::testBytesDecodesQuotedAndPrefixBinaryFormsWithoutDroppingLeadingPartialBytescallsCharsetLexemeGeneratorTest::testBytesDecodesQuotedAndPrefixBinaryFormsWithoutDroppingLeadingPartialBytes#0coversCharsetLexemeGeneratorTest::testBytesDecodesQuotedAndPrefixBinaryFormsWithoutDroppingLeadingPartialBytes#1coversCharsetLexemeGeneratorTest::testBytesDecodesQuotedAndPrefixBinaryFormsWithoutDroppingLeadingPartialBytes#2coversCharsetLexemeGeneratorTest::testBytesDecodesQuotedAndPrefixBinaryFormsWithoutDroppingLeadingPartialBytes#3coversCharsetLexemeGeneratorTest::testBytesDecodesQuotedAndPrefixBinaryFormsWithoutDroppingLeadingPartialBytes#4coversCharsetLexemeGeneratorTest::testBytesDecodesQuotedAndPrefixBinaryFormsWithoutDroppingLeadingPartialBytes#5coversCharsetLexemeGeneratorTest::testBytesDecodesQuotedAndPrefixBinaryFormsWithoutDroppingLeadingPartialBytes#6coversCharsetLexemeGeneratorTest::testGenerateKeepsOnlyCharsetsCompatibleWithTheResolvedLiteralcoversCharsetValueLexemeGeneratorTest::testGenerateSamplesCharsetCompatibleBytesWithoutRestrictingOrdinaryBinaryValuescalls
Called from 1
Calls 11
- method-call RadixDomain::digits() line 49
- new RadixDomain line 49
- function-call
packline 51 - function-call
strlenline 51 - function-call
str_padline 58 - function-call
ceilline 58 - function-call
implodeline 59 - function-call
array_mapline 59 - function-call
chrline 59 - function-call
intvalline 59 - function-call
str_splitline 59
public function accepts(string $charset, string $bytes): boollatin1 and binary accept every byte; ASCII and the two UTF-8 widths retain their own contracts.
Parameters
$charset | string | |
$bytes | string |
Returns
boolTest cases 12
CharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8callsCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#0coversCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#1coversCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#2coversCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#3coversCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#4coversCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#5coversCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#6coversCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#7coversCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#8coversCharsetLexemeGeneratorTest::testGenerateKeepsOnlyCharsetsCompatibleWithTheResolvedLiteralcoversCharsetValueLexemeGeneratorTest::testGenerateSamplesCharsetCompatibleBytesWithoutRestrictingOrdinaryBinaryValuescalls
Called from 1
Calls 3
- function-call
strtolowerline 69 - method-call Utf8::valid() line 71
- new Utf8 line 71
Test cases 28§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 19
CharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8callsCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#0coversCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#1coversCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#2coversCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#3coversCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#4coversCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#5coversCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#6coversCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#7coversCharsetLexemeGeneratorTest::testAcceptsChecksTheSelectedCharsetRatherThanAssumingUtf8#8coversCharsetLexemeGeneratorTest::testBytesDecodesQuotedAndPrefixBinaryFormsWithoutDroppingLeadingPartialBytescallsCharsetLexemeGeneratorTest::testBytesDecodesQuotedAndPrefixBinaryFormsWithoutDroppingLeadingPartialBytes#0coversCharsetLexemeGeneratorTest::testBytesDecodesQuotedAndPrefixBinaryFormsWithoutDroppingLeadingPartialBytes#1coversCharsetLexemeGeneratorTest::testBytesDecodesQuotedAndPrefixBinaryFormsWithoutDroppingLeadingPartialBytes#2coversCharsetLexemeGeneratorTest::testBytesDecodesQuotedAndPrefixBinaryFormsWithoutDroppingLeadingPartialBytes#3coversCharsetLexemeGeneratorTest::testBytesDecodesQuotedAndPrefixBinaryFormsWithoutDroppingLeadingPartialBytes#4coversCharsetLexemeGeneratorTest::testBytesDecodesQuotedAndPrefixBinaryFormsWithoutDroppingLeadingPartialBytes#5coversCharsetLexemeGeneratorTest::testBytesDecodesQuotedAndPrefixBinaryFormsWithoutDroppingLeadingPartialBytes#6coversCharsetLexemeGeneratorTest::testGenerateKeepsOnlyCharsetsCompatibleWithTheResolvedLiteralcovers and calls
Other tests reaching this symbol 9
LexicalExceptionTestcallsGenerationContextTestcallsCharsetValueLexemeGeneratorTest::testGenerateSamplesCharsetCompatibleBytesWithoutRestrictingOrdinaryBinaryValuescallsDefinitionFactoryTestcallsLexicalGrammarTestcallsMySqlProviderTestcallsPostgreSqlProviderTestcallsSqlGeneratorFactoryTestcallsSqliteProviderTestcalls