Skip to content

feat(value objects): small optimisation of key case mapping

Rick Hambrook requested to merge feat/small-truncation-of-key-case-mapping into master

Small optimisation to condense the code and prevent additional if checks (without using else)

Alternatively:

$args = match ($map) {
    'snake',
    'camel',
    'studly' => $args->mapWithKeys(fn($value, $key) => [str($key)->{$map}()->toString() => $value]),
    default => $args,
};

Merge request reports