class DataConfig

Properties

non-empty-list<string> $dateFormats

The accepted date formats in declaration order.

string|null $dateTimezone

The timezone applied while casting and transforming dates.

ValidationStrategy $validationStrategy

The default validation strategy.

null|NameMapper> $inputNameMapper

The default input name mapper.

null|NameMapper> $outputNameMapper

The default output name mapper.

Cast>> $casts

The configured cast overrides.

Transformer>> $transformers

The configured transformer overrides.

RuleInferrer>> $ruleInferrers

The configured rule inferrers, run after the fixed rule inference.

Normalizer>> $normalizers

The configured global normalizers.

string|null $wrap

The default resource wrapper.

int|null $maxTransformationDepth

The maximum nested transformation depth.

bool $ignoreInvalidPartials

Indicates if nested partials targeting unknown properties should be ignored instead of rejected.

bool $throwWhenMaxTransformationDepthReached

Indicates if reaching the maximum transformation depth throws instead of returning an empty array.

bool $ignoreComputedPropertyInput

Indicates if supplied computed property values should be ignored instead of rejected.

protected BaseData>> $morphMap
protected BaseData>, string> $reversedMorphMap

Methods

__construct(Repository $config)

Create a new data configuration.

void
enforceMorphMap(array $map)

Register aliases that abstract data casts store instead of class names.

string|null
getMorphedDataClass(string $alias)

Get the data class registered for a morph alias.

string|null
getDataClassAlias(string $class)

Get the morph alias registered for a data class.

Details

at line 113
__construct(Repository $config)

Create a new data configuration.

Parameters

Repository $config

at line 158
void enforceMorphMap(array $map)

Register aliases that abstract data casts store instead of class names.

The aliases persist on the worker-lifetime configuration and affect every subsequent data cast in the worker.

Parameters

array $map

Return Value

void

at line 206
string|null getMorphedDataClass(string $alias)

Get the data class registered for a morph alias.

Parameters

string $alias

Return Value

string|null

at line 216
string|null getDataClassAlias(string $class)

Get the morph alias registered for a data class.

Parameters

string $class

Return Value

string|null