classStartRuleResolver
final class StartRuleResolver
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Resolves MySQL rule names across grammar releases.
Methods§
public function __construct(private Grammar $grammar)Parameters
$grammar | Grammar | Grammar whose rule names are resolved |
public function startSymbolFor(string|null $requested): stringAnswers which of this grammar's rules a requested start rule is grown from.
MySQL renamed its top-level rules across releases, so the name a caller asks for may not be the name this release declares. A request the grammar knows is taken as it stands; otherwise the rule that release calls the same thing is used, and a request nothing matches is handed back for the derivation to report.
Parameters
$requested | string|null | Rule the caller asked for, or null for the grammar's own entry point |
Returns
string Rule this grammar declaresTest cases 5
StartRuleResolverTest::testStartSymbolForFallsBackToTheEntryPointOfTheReleaseItWasAskedOfcallsStartRuleResolverTest::testStartSymbolForHandsBackARequestNothingMatchescallsStartRuleResolverTest::testStartSymbolForMapsModernRequestsToLegacyGrammarRulescallsStartRuleResolverTest::testStartSymbolForPreservesGrammarEntryEvenWhenStatementRulesExistcallsStartRuleResolverTest::testStartSymbolForTakesARuleThisReleaseDeclaresAsItStandscalls
Private surface 1§
Implementation details, listed for orientation only.
private Grammar $grammarTest cases 10§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
StartRuleResolverTest::testStartSymbolForFallsBackToTheEntryPointOfTheReleaseItWasAskedOfcallsStartRuleResolverTest::testStartSymbolForHandsBackARequestNothingMatchescallsStartRuleResolverTest::testStartSymbolForMapsModernRequestsToLegacyGrammarRulescallsStartRuleResolverTest::testStartSymbolForPreservesGrammarEntryEvenWhenStatementRulesExistcallsStartRuleResolverTest::testStartSymbolForTakesARuleThisReleaseDeclaresAsItStandscalls
Other tests reaching this symbol 5
GenerationContextTestcallsSqlGeneratorFactoryTestcallsMySqlProviderTestcallsPostgreSqlProviderTestcallsSqliteProviderTestcalls