final class ConstructionState

Methods

create(CreationContext $context, string $class)

Create construction state for one root operation.

void
enterProperty(string $property, array $payloadPath)

Enter a nested data property.

void
enterItem(string|int $index)

Enter one data collection item.

void
leave()

Leave the current property or collection item.

int
depth()

Get the current traversal depth.

array
path()

Get the current wire-key path.

void
writeNodeInput(array $input)

Write the normalized input the current node's declared values are filled over.

void
writeNodeValue(mixed $value)

Restore the given value at the current nested path when it cannot be read as node input.

void
writePropertyValue(array $path, mixed $value)

Write a mapped property value beneath the current path.

void
writeFinishedPropertyValue(array $path, mixed $value)

Write a finished mapped property value beneath the current path.

void
forgetPropertyValue(array $path)

Remove a mapped property value beneath the current path.

void
writeItemValue(string|int $key, mixed $value)

Write a raw collection item beneath the current path.

void
writeFinishedItemValue(string|int $key, mixed $value)

Write a finished raw collection item beneath the current path.

bool
hasValue(array $path)

Determine if a value exists beneath the current path.

mixed
getValue(array $path)

Get a value beneath the current path.

mixed
read(array $path)

Read a value beneath the current path, or an unknown property when it is absent.

array
payload()

Get the complete construction payload.

mixed
currentPayload()

Get the payload at the current traversal path.

void
replacePayload(array $payload)

Replace the complete construction payload.

void
recordUnknownInput(array $input)

Record strict input beneath the current traversal path.

array|null
unknownInput()

Get the merged strict input tree.

void
setRuleInferrers(array $ruleInferrers)

Set the rule inferrers resolved for the current compilation.

array
ruleInferrers()

Get the rule inferrers resolved for the current compilation.

void
recordMapping(string $property, string|int $mappedKey)

Record the chosen wire key for a property on the current node.

void
replaceMapping(string $property, string|int $mappedKey)

Replace one selected wire key during hook reconciliation.

void
clearChildStructure(string $property)

Clear one changed child selection during hook reconciliation.

void
resetNodeStructure()

Reset the current class-owned selections during morph reconciliation.

bool
hasOriginalKey(string $property)

Determine if a wire key was recorded for a property on the current node.

string|int
originalKey(string $property)

Get the chosen wire key for a property on the current node.

void
setNodeClass(string $class)

Record the concrete data class selected for the current node.

string|null
nodeClass()

Get the concrete data class selected for the current node.

bool
executionDeferred()

Determine if named factories and constructors wait for the cast that owns the current value.

void
setExecutionDeferred(bool $deferred)

Start or stop deferring execution beneath a cast-owned value.

void
recordNamedFactory(DataClass $dataClass, DataMethod $method, DataMethodMatch $match)

Record the named factory that creates the current node once its owning cast declines.

void
forgetNamedFactory()

Forget the named factory recorded for the current node, whose input a validation hook replaced.

array|null
namedFactory()

Get the named factory recorded for the current node.

void
markContextualValuesPrepared()

Record that the current node's contextual property values were resolved and filled for validation.

bool
contextualValuesPrepared()

Determine if the current node's contextual property values were resolved and filled for validation.

void
recordSelectedType(string $property, NamedType|null $type)

Record the declared type a property's value selected on the current node.

NamedType|null
selectedType(string $property)

Get the declared type a property's value selected on the current node.

void
recordAutoLazy(string $property, mixed $source, AutoLazyReplayMode|null $replay = null)

Record one automatic lazy property recipe.

array|UnknownProperty
autoLazy(string $property)

Get one automatic lazy property recipe.

void
recordPaginatorSource(AbstractPaginator|AbstractCursorPaginator $source)

Record the paginator source for the current node.

paginatorSource()

Get the paginator source for the current node.

void
clearPaginatorSource()

Clear the paginator source for the current node.

bool
isCurrentCollectionUniform()

Determine if the current collection has one uniform recursive structure.

array
structure()

Get the compiled structure tree.

snapshotForProperty(string $property)

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.

Parameters

CreationContext $context
string $class

Return Value

ConstructionState

at line 88
void enterProperty(string $property, array $payloadPath)

Enter a nested data property.

Parameters

string $property
array $payloadPath

Return Value

void

at line 100
void enterItem(string|int $index)

Enter one data collection item.

Parameters

string|int $index

Return Value

void

at line 112
void leave()

Leave the current property or collection item.

Return Value

void

at line 120
int depth()

Get the current traversal depth.

Return Value

int

at line 130
array path()

Get the current wire-key path.

Return Value

array

at line 146
void writeNodeInput(array $input)

Write the normalized input the current node's declared values are filled over.

Parameters

array $input

Return Value

void

at line 162
void writeNodeValue(mixed $value)

Restore the given value at the current nested path when it cannot be read as node input.

Parameters

mixed $value

Return Value

void

at line 172
void writePropertyValue(array $path, mixed $value)

Write a mapped property value beneath the current path.

Parameters

array $path
mixed $value

Return Value

void

at line 186
void writeFinishedPropertyValue(array $path, mixed $value)

Write a finished mapped property value beneath the current path.

Parameters

array $path
mixed $value

Return Value

void

at line 200
void forgetPropertyValue(array $path)

Remove a mapped property value beneath the current path.

Parameters

array $path

Return Value

void

at line 220
void writeItemValue(string|int $key, mixed $value)

Write a raw collection item beneath the current path.

Parameters

string|int $key
mixed $value

Return Value

void

at line 228
void writeFinishedItemValue(string|int $key, mixed $value)

Write a finished raw collection item beneath the current path.

Parameters

string|int $key
mixed $value

Return Value

void

at line 238
bool hasValue(array $path)

Determine if a value exists beneath the current path.

Parameters

array $path

Return Value

bool

at line 250
mixed getValue(array $path)

Get a value beneath the current path.

Parameters

array $path

Return Value

mixed

at line 262
mixed read(array $path)

Read a value beneath the current path, or an unknown property when it is absent.

Parameters

array $path

Return Value

mixed

at line 272
array payload()

Get the complete construction payload.

Return Value

array

at line 280
mixed currentPayload()

Get the payload at the current traversal path.

Return Value

mixed

at line 290
void replacePayload(array $payload)

Replace the complete construction payload.

Parameters

array $payload

Return Value

void

at line 300
void recordUnknownInput(array $input)

Record strict input beneath the current traversal path.

Parameters

array $input

Return Value

void

at line 329
array|null unknownInput()

Get the merged strict input tree.

Return Value

array|null

at line 339
void setRuleInferrers(array $ruleInferrers)

Set the rule inferrers resolved for the current compilation.

Parameters

array $ruleInferrers

Return Value

void

at line 349
array ruleInferrers()

Get the rule inferrers resolved for the current compilation.

Return Value

array

at line 357
void recordMapping(string $property, string|int $mappedKey)

Record the chosen wire key for a property on the current node.

Parameters

string $property
string|int $mappedKey

Return Value

void

at line 385
void replaceMapping(string $property, string|int $mappedKey)

Replace one selected wire key during hook reconciliation.

Parameters

string $property
string|int $mappedKey

Return Value

void

at line 407
void clearChildStructure(string $property)

Clear one changed child selection during hook reconciliation.

Parameters

string $property

Return Value

void

at line 424
void resetNodeStructure()

Reset the current class-owned selections during morph reconciliation.

Return Value

void

at line 445
bool hasOriginalKey(string $property)

Determine if a wire key was recorded for a property on the current node.

Parameters

string $property

Return Value

bool

at line 461
string|int originalKey(string $property)

Get the chosen wire key for a property on the current node.

Parameters

string $property

Return Value

string|int

at line 483
void setNodeClass(string $class)

Record the concrete data class selected for the current node.

Parameters

string $class

Return Value

void

at line 513
string|null nodeClass()

Get the concrete data class selected for the current node.

Return Value

string|null

at line 527
bool executionDeferred()

Determine if named factories and constructors wait for the cast that owns the current value.

Return Value

bool

at line 535
void setExecutionDeferred(bool $deferred)

Start or stop deferring execution beneath a cast-owned value.

Parameters

bool $deferred

Return Value

void

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.

Parameters

DataClass $dataClass
DataMethod $method
DataMethodMatch $match

Return Value

void

at line 560
void forgetNamedFactory()

Forget the named factory recorded for the current node, whose input a validation hook replaced.

Return Value

void

at line 580
array|null namedFactory()

Get the named factory recorded for the current node.

Return Value

array|null

at line 596
void markContextualValuesPrepared()

Record that the current node's contextual property values were resolved and filled for validation.

Return Value

void

at line 610
bool contextualValuesPrepared()

Determine if the current node's contextual property values were resolved and filled for validation.

Return Value

bool

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.

Parameters

string $property
NamedType|null $type

Return Value

void

at line 654
NamedType|null selectedType(string $property)

Get the declared type a property's value selected on the current node.

Parameters

string $property

Return Value

NamedType|null

at line 668
void recordAutoLazy(string $property, mixed $source, AutoLazyReplayMode|null $replay = null)

Record one automatic lazy property recipe.

Parameters

string $property
mixed $source
AutoLazyReplayMode|null $replay

Return Value

void

at line 691
array|UnknownProperty autoLazy(string $property)

Get one automatic lazy property recipe.

Parameters

string $property

Return Value

array|UnknownProperty

at line 707
void recordPaginatorSource(AbstractPaginator|AbstractCursorPaginator $source)

Record the paginator source for the current node.

Parameters

AbstractPaginator|AbstractCursorPaginator $source

Return Value

void

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.

Return Value

void

at line 766
bool isCurrentCollectionUniform()

Determine if the current collection has one uniform recursive structure.

Return Value

bool

at line 776
array structure()

Get the compiled structure tree.

Return Value

array

at line 784
ConstructionState snapshotForProperty(string $property)

Create a detached baseline for one automatic lazy property.

Parameters

string $property

Return Value

ConstructionState