ConstructionState
final class ConstructionState
Methods
Enter a nested data property.
Enter one data collection item.
Leave the current property or collection item.
Get the current traversal depth.
Get the current wire-key path.
Write the normalized input the current node's declared values are filled over.
Restore the given value at the current nested path when it cannot be read as node input.
Write a mapped property value beneath the current path.
Write a finished mapped property value beneath the current path.
Remove a mapped property value beneath the current path.
Write a raw collection item beneath the current path.
Write a finished raw collection item beneath the current path.
Determine if a value exists beneath the current path.
Get a value beneath the current path.
Read a value beneath the current path, or an unknown property when it is absent.
Get the complete construction payload.
Get the payload at the current traversal path.
Replace the complete construction payload.
Record strict input beneath the current traversal path.
Get the merged strict input tree.
Set the rule inferrers resolved for the current compilation.
Get the rule inferrers resolved for the current compilation.
Record the chosen wire key for a property on the current node.
Replace one selected wire key during hook reconciliation.
Clear one changed child selection during hook reconciliation.
Reset the current class-owned selections during morph reconciliation.
Determine if a wire key was recorded for a property on the current node.
Get the chosen wire key for a property on the current node.
Record the concrete data class selected for the current node.
Get the concrete data class selected for the current node.
Determine if named factories and constructors wait for the cast that owns the current value.
Start or stop deferring execution beneath a cast-owned value.
Record the named factory that creates the current node once its owning cast declines.
Forget the named factory recorded for the current node, whose input a validation hook replaced.
Get the named factory recorded for the current node.
Record that the current node's contextual property values were resolved and filled for validation.
Determine if the current node's contextual property values were resolved and filled for validation.
Record the declared type a property's value selected on the current node.
Get the declared type a property's value selected on the current node.
Record one automatic lazy property recipe.
Get one automatic lazy property recipe.
Record the paginator source for the current node.
Get the paginator source for the current node.
Clear the paginator source for the current node.
Determine if the current collection has one uniform recursive structure.
Get the compiled structure tree.
Create a detached baseline for one automatic lazy property.
Details
at line 78
static ConstructionState
create(CreationContext $context, string $class)
Create construction state for one root operation.
at line 88
void
enterProperty(string $property, array $payloadPath)
Enter a nested data property.
at line 100
void
enterItem(string|int $index)
Enter one data collection item.
at line 112
void
leave()
Leave the current property or collection item.
at line 120
int
depth()
Get the current traversal depth.
at line 130
array
path()
Get the current wire-key path.
at line 146
void
writeNodeInput(array $input)
Write the normalized input the current node's declared values are filled over.
at line 162
void
writeNodeValue(mixed $value)
Restore the given value at the current nested path when it cannot be read as node input.
at line 172
void
writePropertyValue(array $path, mixed $value)
Write a mapped property value beneath the current path.
at line 186
void
writeFinishedPropertyValue(array $path, mixed $value)
Write a finished mapped property value beneath the current path.
at line 200
void
forgetPropertyValue(array $path)
Remove a mapped property value beneath the current path.
at line 220
void
writeItemValue(string|int $key, mixed $value)
Write a raw collection item beneath the current path.
at line 228
void
writeFinishedItemValue(string|int $key, mixed $value)
Write a finished raw collection item beneath the current path.
at line 238
bool
hasValue(array $path)
Determine if a value exists beneath the current path.
at line 250
mixed
getValue(array $path)
Get a value beneath the current path.
at line 262
mixed
read(array $path)
Read a value beneath the current path, or an unknown property when it is absent.
at line 272
array
payload()
Get the complete construction payload.
at line 280
mixed
currentPayload()
Get the payload at the current traversal path.
at line 290
void
replacePayload(array $payload)
Replace the complete construction payload.
at line 300
void
recordUnknownInput(array $input)
Record strict input beneath the current traversal path.
at line 329
array|null
unknownInput()
Get the merged strict input tree.
at line 339
void
setRuleInferrers(array $ruleInferrers)
Set the rule inferrers resolved for the current compilation.
at line 349
array
ruleInferrers()
Get the rule inferrers resolved for the current compilation.
at line 357
void
recordMapping(string $property, string|int $mappedKey)
Record the chosen wire key for a property on the current node.
at line 385
void
replaceMapping(string $property, string|int $mappedKey)
Replace one selected wire key during hook reconciliation.
at line 407
void
clearChildStructure(string $property)
Clear one changed child selection during hook reconciliation.
at line 424
void
resetNodeStructure()
Reset the current class-owned selections during morph reconciliation.
at line 445
bool
hasOriginalKey(string $property)
Determine if a wire key was recorded for a property on the current node.
at line 461
string|int
originalKey(string $property)
Get the chosen wire key for a property on the current node.
at line 483
void
setNodeClass(string $class)
Record the concrete data class selected for the current node.
at line 513
string|null
nodeClass()
Get the concrete data class selected for the current node.
at line 527
bool
executionDeferred()
Determine if named factories and constructors wait for the cast that owns the current value.
at line 535
void
setExecutionDeferred(bool $deferred)
Start or stop deferring execution beneath a cast-owned value.
at line 545
void
recordNamedFactory(DataClass $dataClass, DataMethod $method, DataMethodMatch $match)
Record the named factory that creates the current node once its owning cast declines.
Each node keeps its own match, because the match holds that node's input.
at line 560
void
forgetNamedFactory()
Forget the named factory recorded for the current node, whose input a validation hook replaced.
at line 580
array|null
namedFactory()
Get the named factory recorded for the current node.
at line 596
void
markContextualValuesPrepared()
Record that the current node's contextual property values were resolved and filled for validation.
at line 610
bool
contextualValuesPrepared()
Determine if the current node's contextual property values were resolved and filled for validation.
at line 624
void
recordSelectedType(string $property, NamedType|null $type)
Record the declared type a property's value selected on the current node.
Null records that the value is kept by a type that needs no conversion, or that no single type selects it.
at line 654
NamedType|null
selectedType(string $property)
Get the declared type a property's value selected on the current node.
at line 668
void
recordAutoLazy(string $property, mixed $source, AutoLazyReplayMode|null $replay = null)
Record one automatic lazy property recipe.
at line 691
array|UnknownProperty
autoLazy(string $property)
Get one automatic lazy property recipe.
at line 707
void
recordPaginatorSource(AbstractPaginator|AbstractCursorPaginator $source)
Record the paginator source for the current node.
at line 724
AbstractPaginator|AbstractCursorPaginator|null
paginatorSource()
Get the paginator source for the current node.
Item reads never fall back to the collection template because paginator metadata belongs to one concrete source value.
at line 736
void
clearPaginatorSource()
Clear the paginator source for the current node.
at line 766
bool
isCurrentCollectionUniform()
Determine if the current collection has one uniform recursive structure.
at line 776
array
structure()
Get the compiled structure tree.
at line 784
ConstructionState
snapshotForProperty(string $property)
Create a detached baseline for one automatic lazy property.