DataValidationCompiler
class DataValidationCompiler
Constants
| protected PRESENCE_RULES |
|
Methods
Create a data validation compiler.
Compile validation for one filled root data collection.
Compile one data node into the root rule graph.
Compile nested rules for one data iterable.
Compile one data iterable from its current structure path.
Compile dynamic items at one wildcard path when their complete output matches.
Infer fixed presence and type rules for one property.
Infer fixed presence and type rules for one property.
Apply class-owned rule replacements in PHP property-name space.
Collapse concrete translations onto an existing authoritative wildcard rule.
Apply class-owned messages and attribute labels in PHP property-name space.
Invoke one array-returning validation lifecycle method.
Translate a class rule key to its observed wire paths.
Recursively translate class-rule segments through Data metadata.
Append rule segments that no longer describe Data properties.
Append wildcard identity markers after every rule replacement is complete.
Determine if a rule list contains a distinct rule.
Merge rule lists without duplicating identical string rules.
Determine if a rule list explicitly controls field presence.
Determine if item rules can differ across one collection.
Get the wire key selected during Fill or its canonical fallback.
Record an exact field or opaque subtree excluded from rule compilation.
Determine if a skipped property can contain nested input.
Determine if a validated property has no recursive schema.
Determine if a named object type has no Data-owned child schema.
Details
at line 47
__construct(DataClassRepository $dataClasses, Container $container, RuleDenormalizer $ruleDenormalizer)
Create a data validation compiler.
at line 57
CompiledValidation
compile(ConstructionState $state)
Compile validation for one filled data graph.
at line 92
CompiledValidation
compileCollection(ConstructionState $state, string $dataClass)
Compile validation for one filled root data collection.
at line 131
protected void
compileNode(string $class, ConstructionState $state, ValidationPath $path, ValidationPath $structuralPath, ValidationAccumulator $accumulator, array $lifecycleDeclarations, bool $compileUnknownFields, bool $observed = true)
Compile one data node into the root rule graph.
at line 292
protected void
compileDataIterable(DataProperty $property, string $dataClass, array $values, ConstructionState $state, ValidationPath $path, ValidationPath $structuralPath, ValidationAccumulator $accumulator, array $lifecycleDeclarations, bool $compileUnknownFields)
Compile nested rules for one data iterable.
at line 329
protected void
compileDataIterableValues(string $dataClass, array $values, ConstructionState $state, ValidationPath $path, ValidationPath $structuralPath, ValidationAccumulator $accumulator, array $lifecycleDeclarations, bool $compileUnknownFields)
Compile one data iterable from its current structure path.
at line 449
protected ValidationAccumulator|null
compileUniformDynamicIterable(string $dataClass, array $values, ConstructionState $state, ValidationPath $path, ValidationPath $structuralPath, array $lifecycleDeclarations, bool $compileUnknownFields)
Compile dynamic items at one wildcard path when their complete output matches.
at line 497
protected array
propertyRules(DataProperty $property, ValidationPath $nodePath, ValidationPath $propertyPath, mixed $value, ConstructionState $state, bool $expectsArray, bool $inferredRequired)
Infer fixed presence and type rules for one property.
at line 551
protected array
inferRules(DataProperty $property, bool $expectsArray, bool $hasPresenceRule = false)
Infer fixed presence and type rules for one property.
at line 579
protected void
applyClassRules(DataClass $dataClass, ConstructionState $state, ValidationPath $path, ValidationPath $structuralPath, ValidationAccumulator $accumulator, bool $observed)
Apply class-owned rule replacements in PHP property-name space.
at line 672
protected array
collapseTranslatedRulePaths(array $paths, ValidationAccumulator $accumulator)
Collapse concrete translations onto an existing authoritative wildcard rule.
at line 700
protected void
applyClassMessagesAndAttributes(DataClass $dataClass, ConstructionState $state, ValidationPath $path, ValidationPath $structuralPath, ValidationAccumulator $accumulator, array $lifecycleDeclarations, bool $observed)
Apply class-owned messages and attribute labels in PHP property-name space.
at line 782
protected array
callArrayLifecycleMethod(DataClass $dataClass, string $method, array $parameters = [])
Invoke one array-returning validation lifecycle method.
at line 809
protected array
translateRulePaths(string $key, DataClass $dataClass, ConstructionState $state, ValidationPath $path, ValidationPath $structuralPath, bool $observed)
Translate a class rule key to its observed wire paths.
at line 834
protected array
translateRuleSegments(array $segments, int $offset, DataClass $dataClass, ConstructionState $state, ValidationPath $path, ValidationPath $structuralPath, bool $observed)
Recursively translate class-rule segments through Data metadata.
at line 1027
protected ValidationPath
appendUnmappedSegments(ValidationPath $path, array $segments, int $offset)
Append rule segments that no longer describe Data properties.
at line 1044
protected void
appendStructuralMarkers(ValidationAccumulator $accumulator, array $payload)
Append wildcard identity markers after every rule replacement is complete.
at line 1122
protected bool
hasDistinctRule(array $rules)
Determine if a rule list contains a distinct rule.
at line 1146
protected array
mergeRules(array $rules, array $additionalRules)
Merge rule lists without duplicating identical string rules.
at line 1164
protected bool
hasPresenceRule(array $rules)
Determine if a rule list explicitly controls field presence.
at line 1190
protected bool
usesDynamicRules(string $dataClass, ConstructionState $state)
Determine if item rules can differ across one collection.
at line 1202
protected string|null
primitiveRule(DataProperty $property)
Get one unambiguous primitive validation rule.
at line 1227
protected string|int
wireKey(DataProperty $property, ConstructionState $state, bool $observed)
Get the wire key selected during Fill or its canonical fallback.
at line 1244
protected void
recordAuxiliaryPath(DataProperty $property, ValidationPath $path, ValidationAccumulator $accumulator)
Record an exact field or opaque subtree excluded from rule compilation.
at line 1259
protected bool
canContainDescendants(DataProperty $property)
Determine if a skipped property can contain nested input.
at line 1280
protected bool
hasUnstructuredDescendants(DataProperty $property)
Determine if a validated property has no recursive schema.
at line 1298
protected bool
isUnstructuredObject(NamedType $type)
Determine if a named object type has no Data-owned child schema.