class HeadData implements Transient

Normalized head state: a collection of tag builders with layer semantics.

Properties

protected TagBuilder> $builders

Methods

array
builders()

Get all tag builders.

TagBuilder|null
get(string $builder)

Get an existing tag builder.

builder(string $class)

Resolve a mutable tag builder instance, creating and storing it on first use.

overlayBuilder(TagBuilder $builder)

Overlay the given builder onto any existing builder of the same type.

merge(HeadData $data)

Merge the given data over this data into a new instance.

bool
isEmpty()

Determine whether the head data has no tags.

asDefaults()

Mark all builders as belonging to the defaults layer.

replicate()

Copy the data and its builders for independent coroutine state.

Details

at line 23
array builders()

Get all tag builders.

Return Value

array

at line 33
TagBuilder|null get(string $builder)

Get an existing tag builder.

Parameters

string $builder

Return Value

TagBuilder|null

at line 46
TagBuilder builder(string $class)

Resolve a mutable tag builder instance, creating and storing it on first use.

Parameters

string $class

Return Value

TagBuilder

at line 55
HeadData overlayBuilder(TagBuilder $builder)

Overlay the given builder onto any existing builder of the same type.

Parameters

TagBuilder $builder

Return Value

HeadData

at line 66
HeadData merge(HeadData $data)

Merge the given data over this data into a new instance.

Parameters

HeadData $data

Return Value

HeadData

at line 80
bool isEmpty()

Determine whether the head data has no tags.

Return Value

bool

at line 94
HeadData asDefaults()

Mark all builders as belonging to the defaults layer.

Return Value

HeadData

at line 108
HeadData replicate()

Copy the data and its builders for independent coroutine state.

Return Value

HeadData