classGenerationContext
final class GenerationContext
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Binds the MySql grammar and lexical declarations to the common SQL generation engine.
Properties§
public Grammar $grammarCommon grammar prepared for generation.
public LexicalGrammar $lexicalGrammarLexical realization for this release.
public TokenRewriter $rewriterDeclared structural transformations for this dialect.
public Closure(string|null): string|null $startSymbolMethods§
public function __construct(Grammar $grammar, Generator $faker, string|null $version = null)Prepares dialect inputs for the common generator.
Parameters
$grammar | Grammar | Common AST for this release |
$faker | Generator | Source of random lexical choices |
$version | string|null | Exact release or null for the declared default |
Throws
RuntimeException When the requested release is unavailableTest cases 5
GenerationContextTest::testBindsTheRequestedReleaseAndPreservesTheGrammarStartcoversGenerationContextTest::testLeavesThePlanInControlOfNullableProductionChoicescoversGenerationContextTest::testReportsAnUnknownNonterminalWithoutTreatingItAsSqlTextcoversGenerationContextTest::testReportsMissingLexicalImplementationWhenTheTerminalIsActuallyGeneratedcoversGenerationContextTest::testUsesTheGrammarStartWhenThePlanDoesNotSpecifyOnecovers
Calls 6
- static-call MySqlGrammar::resolveVersion() line 53
- new LexicalGrammar line 54
- method-call RewriteDefinitions::create() line 56
- new RewriteDefinitions line 56
- method-call StartRuleResolver::startSymbolFor() line 57
- new StartRuleResolver line 57
Test cases 9§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
GenerationContextTest::testBindsTheRequestedReleaseAndPreservesTheGrammarStartcovers and callsGenerationContextTest::testLeavesThePlanInControlOfNullableProductionChoicescovers and callsGenerationContextTest::testReportsAnUnknownNonterminalWithoutTreatingItAsSqlTextcovers and callsGenerationContextTest::testReportsMissingLexicalImplementationWhenTheTerminalIsActuallyGeneratedcovers and callsGenerationContextTest::testUsesTheGrammarStartWhenThePlanDoesNotSpecifyOnecovers and calls
Other tests reaching this symbol 4
MySqlProviderTestcallsPostgreSqlProviderTestcallsSqlGeneratorFactoryTestcallsSqliteProviderTestcalls