class DataCollectableFactory

Methods

array|null
items(mixed $value)

Extract keyed items from a supported collection value.

mixed
forMethodSource(string $dataClass, mixed $source, array|Enumerable $items)

Rebuild normalized items in the source shape used by collection factories.

mixed
forTarget(string $dataClass, mixed $source, array|Enumerable $items, string|null $into)

Rebuild normalized items in an explicit or source-inferred target.

void
retainPaginatorSource(NamedType $type, mixed $value, ConstructionState $state)

Retain the source needed to rebuild one paginated property.

mixed
forProperty(NamedType $type, array $items, ConstructionState $state)

Rebuild typed items in a property's declared container.

newEnumerable(string $class, array $items)

Rebuild an eager enumerable in its declared collection class.

paginator(NamedType $type, array $items, ConstructionState $state)

Clone the retained paginator and replace only its items.

cursorPaginator(NamedType $type, array $items, ConstructionState $state)

Clone the retained cursor paginator and replace only its items.

mixed
rebuildRoot(string $dataClass, mixed $source, array|Enumerable $items)

Rebuild normalized items in their supported root source shape.

rebuildPaginator(mixed $source, array|Enumerable $items, string $into)

Clone an offset paginator source with normalized items.

rebuildCursorPaginator(mixed $source, array|Enumerable $items, string $into)

Clone a cursor paginator source with normalized items.

array
eagerItems(array|Enumerable $items)

Materialize normalized items without changing their keys.

bool
canRebuildRoot(mixed $source)

Determine if normalized items can safely retain the root source shape.

Details

at line 33
array|null items(mixed $value)

Extract keyed items from a supported collection value.

Parameters

mixed $value

Return Value

array|null

at line 59
mixed forMethodSource(string $dataClass, mixed $source, array|Enumerable $items)

Rebuild normalized items in the source shape used by collection factories.

Contract-only paginators intentionally have no method-dispatch shape because their metadata cannot be cloned without mutating an unknown implementation.

Parameters

string $dataClass
mixed $source
array|Enumerable $items

Return Value

mixed

at line 77
mixed forTarget(string $dataClass, mixed $source, array|Enumerable $items, string|null $into)

Rebuild normalized items in an explicit or source-inferred target.

Parameters

string $dataClass
mixed $source
array|Enumerable $items
string|null $into

Return Value

mixed

at line 146
void retainPaginatorSource(NamedType $type, mixed $value, ConstructionState $state)

Retain the source needed to rebuild one paginated property.

Parameters

NamedType $type
mixed $value
ConstructionState $state

Return Value

void

at line 195
mixed forProperty(NamedType $type, array $items, ConstructionState $state)

Rebuild typed items in a property's declared container.

Parameters

NamedType $type
array $items
ConstructionState $state

Return Value

mixed

at line 230
protected Enumerable newEnumerable(string $class, array $items)

Rebuild an eager enumerable in its declared collection class.

Parameters

string $class
array $items

Return Value

Enumerable

at line 248
protected AbstractPaginator paginator(NamedType $type, array $items, ConstructionState $state)

Clone the retained paginator and replace only its items.

Parameters

NamedType $type
array $items
ConstructionState $state

Return Value

AbstractPaginator

at line 267
protected AbstractCursorPaginator cursorPaginator(NamedType $type, array $items, ConstructionState $state)

Clone the retained cursor paginator and replace only its items.

Parameters

NamedType $type
array $items
ConstructionState $state

Return Value

AbstractCursorPaginator

at line 287
protected mixed rebuildRoot(string $dataClass, mixed $source, array|Enumerable $items)

Rebuild normalized items in their supported root source shape.

Parameters

string $dataClass
mixed $source
array|Enumerable $items

Return Value

mixed

at line 333
protected AbstractPaginator rebuildPaginator(mixed $source, array|Enumerable $items, string $into)

Clone an offset paginator source with normalized items.

Parameters

mixed $source
array|Enumerable $items
string $into

Return Value

AbstractPaginator

at line 354
protected AbstractCursorPaginator rebuildCursorPaginator(mixed $source, array|Enumerable $items, string $into)

Clone a cursor paginator source with normalized items.

Parameters

mixed $source
array|Enumerable $items
string $into

Return Value

AbstractCursorPaginator

at line 376
protected array eagerItems(array|Enumerable $items)

Materialize normalized items without changing their keys.

Parameters

array|Enumerable $items

Return Value

array

at line 384
protected bool canRebuildRoot(mixed $source)

Determine if normalized items can safely retain the root source shape.

Parameters

mixed $source

Return Value

bool