trait MergesProps

Properties

protected bool $merge

Indicates if the property should be merged.

protected bool $deepMerge

Indicates if the property should be deep merged.

protected array<int, string> $matchOn

The properties to match on for merging.

protected bool $append

Indicates if the property values should be appended or prepended.

protected array<int, string> $appendsAtPaths

The paths to append.

protected array<int, string> $prependsAtPaths

The paths to prepend.

Methods

merge()

Mark the property for merging.

deepMerge()

Mark the property for deep merging.

matchOn(string|array $matchOn)

Set the properties to match on for merging.

bool
shouldMerge()

Determine if the property should be merged.

bool
shouldDeepMerge()

Determine if the property should be deep merged.

array
matchesOn()

Get the properties to match on for merging.

bool
appendsAtRoot()

Determine if the property should be appended at the root level.

bool
prependsAtRoot()

Determine if the property should be prepended at the root level.

bool
mergesAtRoot()

Determine if the property merges at the root level.

append(bool|string|array $path = true, string|null $matchOn = null)

Specify that the value should be appended, optionally providing a key to append and a property to match on.

prepend(bool|string|array $path = true, string|null $matchOn = null)

Specify that the value should be prepended, optionally providing a key to prepend and a property to match on.

array
appendsAtPaths()

Get the paths to append.

array
prependsAtPaths()

Get the paths to prepend.

Details

at line 50
MergesProps merge()

Mark the property for merging.

Return Value

MergesProps

at line 60
MergesProps deepMerge()

Mark the property for deep merging.

Return Value

MergesProps

at line 72
MergesProps matchOn(string|array $matchOn)

Set the properties to match on for merging.

Parameters

string|array $matchOn

Return Value

MergesProps

at line 82
bool shouldMerge()

Determine if the property should be merged.

Return Value

bool

at line 90
bool shouldDeepMerge()

Determine if the property should be deep merged.

Return Value

bool

at line 100
array matchesOn()

Get the properties to match on for merging.

Return Value

array

at line 108
bool appendsAtRoot()

Determine if the property should be appended at the root level.

Return Value

bool

at line 116
bool prependsAtRoot()

Determine if the property should be prepended at the root level.

Return Value

bool

at line 124
protected bool mergesAtRoot()

Determine if the property merges at the root level.

Return Value

bool

at line 134
MergesProps append(bool|string|array $path = true, string|null $matchOn = null)

Specify that the value should be appended, optionally providing a key to append and a property to match on.

Parameters

bool|string|array $path
string|null $matchOn

Return Value

MergesProps

at line 156
MergesProps prepend(bool|string|array $path = true, string|null $matchOn = null)

Specify that the value should be prepended, optionally providing a key to prepend and a property to match on.

Parameters

bool|string|array $path
string|null $matchOn

Return Value

MergesProps

at line 178
array appendsAtPaths()

Get the paths to append.

Return Value

array

at line 188
array prependsAtPaths()

Get the paths to prepend.

Return Value

array