Skip to content

API reference / Quittio \ Core \ Data \ Concerns

Immutable

trait in quittio/core

Quittio\Core\Data\Concerns\Immutable · Source

Generic copy-on-write helper for readonly DTOs whose properties are all promoted constructor parameters.

Methods#

MethodDescription
->with()Returns a copy with the given properties replaced.

with()#

public function with(array<string, mixed> $changes): static

Returns a copy with the given properties replaced.

ParameterTypeDescription
$changesarray<string, mixed>
Returns
static

The open core packages are MIT licensed. The legal wording of the country packs must be confirmed by a tax adviser.