classCandidateResolver
final class CandidateResolver
Evaluates one complete candidate against its internal and external boundaries.
Methods§
public function __construct(private SpacingRule $spacing)Binds the composed boundary rules independently of candidate selection.
Parameters
$spacing | SpacingRule |
Test cases 4
CandidateResolverTest::testResolveIntersectsInternalAndExternalConstraintsWithoutChangingTheRightStatecoversCandidateResolverTest::testResolvePropagatesConditionsAcrossAnEmptyMarkerWithoutWritingSpacescoversCandidateResolverTest::testResolveRejectsAnOwedNeighborAtEitherEndOfTheInputcoversCandidateResolverTest::testResolveReportsContradictionsWithBothRuleSourcescovers
public function resolve(
LexemeSequence $sequence,
LexemeInput $input,
): ResolvedOutput|SpacingConstraintParameters
$sequence | LexemeSequence | |
$input | LexemeInput |
Returns
ResolvedOutput|SpacingConstraint A contradiction is returned without changing the input.Test cases 4
CandidateResolverTest::testResolveIntersectsInternalAndExternalConstraintsWithoutChangingTheRightStatecovers and callsCandidateResolverTest::testResolvePropagatesConditionsAcrossAnEmptyMarkerWithoutWritingSpacescovers and callsCandidateResolverTest::testResolveRejectsAnOwedNeighborAtEitherEndOfTheInputcovers and callsCandidateResolverTest::testResolveReportsContradictionsWithBothRuleSourcescovers and calls
Called from 3
- method-call SqlFaker\Generation\Output\BoundaryCompletion::accepts() packages/sql-faker/src/Generation/Output/BoundaryCompletion.php:55
- method-call SqlFaker\Generation\Output\ReverseLexemeGenerator::select() packages/sql-faker/src/Generation/Output/ReverseLexemeGenerator.php:93
- method-call SqlFaker\Generation\Output\ReverseLexemeGenerator::select() packages/sql-faker/src/Generation/Output/ReverseLexemeGenerator.php:117
Calls 8
- function-call
countline 34 - class-const SpacingConstraint::EITHER() line 36
- new SpacingConstraint line 37
- method-call SpacingRule::apply() line 46
- new LexemeBoundary line 46
- function-call
array_unshiftline 53 - new OutputPart line 53
- new ResolvedOutput line 62
Private surface 1§
Implementation details, listed for orientation only.
private SpacingRule $spacingTest cases 62§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
CandidateResolverTest::testResolveIntersectsInternalAndExternalConstraintsWithoutChangingTheRightStatecovers and callsCandidateResolverTest::testResolvePropagatesConditionsAcrossAnEmptyMarkerWithoutWritingSpacescovers and callsCandidateResolverTest::testResolveRejectsAnOwedNeighborAtEitherEndOfTheInputcovers and callsCandidateResolverTest::testResolveReportsContradictionsWithBothRuleSourcescovers and calls
Other tests reaching this symbol 58
BytePlanCompilerTest::testCompileMapsTheHeaderIntoTheAllowedExpansionRangecallsBytePlanCompilerTest::testCompileResolvesChoicesIntoInspectableReusableInstructionscallsBytePlanCompilerTest::testCompileSeparatesProductionChoicesFromLexemesAndCompletesAnOddInputcallsPlanBuilderTest::testBuildPreservesEmptyMarkerCandidatesWithoutLosingNonEmptyCompletioncallsPlanBuilderTest::testBuildPreservesRepeatedProductionAndLexemeConstraintscallsPlanBuilderTest::testBuildReservesAllPendingSiblingsAndRetainsTheOriginalOrdinalcallsPlanBuilderTest::testBuildUsesTheSameContextualRewriteAndPinsItsCompleteCandidatecallsPlanBuilderTest::testMinimumExpansionsIncludesTheConstrainedDescendantBeforeDrawingTheBudgetcallsPlanBuilderTest::testMinimumExpansionsIncludesTheSelectedRootAlternativeBeforeAllocatingInputBudgetcallsGrammarCoverageTest::testRecordOutputExposesCandidateAndBoundaryDecisionscallsDerivationTraceTestcallsTokenGeneratorTestcallsLexicalExceptionTestcallsLexemeSequenceTestcallsBoundaryCompletionTest::testAcceptsOnlyCandidatesWhosePendingLeftBoundaryHasACompletioncallsBoundaryCompletionTest::testAcceptsRejectsMissingOrPlannedAwayWitnessescallsBoundaryCompletionTest::testAcceptsUsesTheSampledLeftValueInsteadOfAnUnrelatedDefaultWitnesscallsReverseLexemeGeneratorTest::testConflictingCandidateIsNotSelectedOrAllowedToAlterAnotherCandidatecallsReverseLexemeGeneratorTest::testGenerateCompoundOutputRemainsInOrderAndEofAddsNoBoundarycallsReverseLexemeGeneratorTest::testGenerateRespectsTheOrderOfRepeatedPlannedOccurrencesAfterRenamingcallsReverseLexemeGeneratorTest::testGenerateRetainsAPlannedSpellingWhenAContextualRewriteRenamesItsTerminalcallsReverseLexemeGeneratorTest::testMatchesRequestComparesTheWholeCompoundSpellingcallsReverseLexemeGeneratorTest::testMissingHandlerFailsAtTheActualTerminalcallsReverseLexemeGeneratorTest::testSelectCanChooseTheLastOfSeveralCompatibleCandidatescallsReverseLexemeGeneratorTest::testSelectRejectsAnOutOfRangeDecisioncallsReverseLexemeGeneratorTest::testSelectReportsCandidateAndBoundarySourcesWhenAllCandidatesConflictcallsSqlGeneratorTest::testGenerateAllowsEmptyOutputWhenThePlanAllowsItcallsSqlGeneratorTest::testGenerateClearsPreviousGrammarTraceBeforeALexicalPlancallsSqlGeneratorTest::testGenerateKeepsRewrittenSourcesReachedWithoutCreditingTheirOutputcallsSqlGeneratorTest::testGenerateRecordsACompleteCoverageObservationcallsSqlGeneratorTest::testGenerateRejectsUnexpectedEmptyOutputWithoutRetryingcallsSqlGeneratorTest::testGenerateReplacesGrammarCoverageWithTheLatestLexicalTracecallsSqlGeneratorTest::testGenerateReportsOnlyTheLatestRewrittenDerivationcallsSqlGeneratorTest::testGenerateReusesCompletionAnalysisAcrossDifferentPlanscallsSqlGeneratorTest::testGenerateUsesExplicitRulesAndSuppliedParserSemanticscallsSqlGeneratorTest::testGenerateUsesTheGrammarEntryPointWithoutDialectKnowledgecallsSqlGeneratorTest::testGenerateUsesTheSuppliedVersionSpecificRuleResolvercallsSqlGeneratorTest::testPlannerBindsTheSameGrammarEntryAndFreezesEveryChoicecallsSqlGeneratorTest::testRealizeOffersTheWholeZeroBasedCandidateRangecallsSqlGeneratorTest::testRealizeRetainsTheActualTerminalAndLexicalTracecallsTerminalSequenceTestcallsGenerationContextTestcallsCharsetValueLexemeGeneratorTestcallsDefinitionFactoryTestcallsLexicalDefinitionTestcallsLexicalGrammarTestcallsMySqlProviderTestcallsGenerationContextTestcallsDefinitionFactoryTestcallsLexicalDefinitionTestcallsLexicalGrammarTestcallsPostgreSqlProviderTestcallsSqlGeneratorFactoryTestcallsGenerationContextTestcallsDefinitionFactoryTestcallsLexicalDefinitionTestcallsLexicalGrammarTestcallsSqliteProviderTestcalls
Relations§
Instantiated in 3
- new SqlFaker\MySql\Generation\Lexeme\LexicalDefinition::__construct() packages/sql-faker/src/MySql/Generation/Lexeme/LexicalDefinition.php:38
- new SqlFaker\PostgreSql\Generation\Lexeme\LexicalDefinition::__construct() packages/sql-faker/src/PostgreSql/Generation/Lexeme/LexicalDefinition.php:34
- new SqlFaker\Sqlite\Generation\Lexeme\LexicalDefinition::__construct() packages/sql-faker/src/Sqlite/Generation/Lexeme/LexicalDefinition.php:32
Method calls 3
- method-call SqlFaker\Generation\Output\BoundaryCompletion::accepts() packages/sql-faker/src/Generation/Output/BoundaryCompletion.php:55
- method-call SqlFaker\Generation\Output\ReverseLexemeGenerator::select() packages/sql-faker/src/Generation/Output/ReverseLexemeGenerator.php:93
- method-call SqlFaker\Generation\Output\ReverseLexemeGenerator::select() packages/sql-faker/src/Generation/Output/ReverseLexemeGenerator.php:117