/**
* @param array<string, mixed> $rawData
*/
private function createDataStack(EntityExistence
$existence, EntityDefinition
$definition, WriteParameterBag
$parameters, array
$rawData): DataStack
{ if ($existence->
exists()) { return new DataStack($rawData);
} $defaults =
$existence->
isChild() ?
$definition->
getChildDefaults() :
$definition->
getDefaults();
if ($defaults ===
[]) { return new DataStack($rawData);
} $toBeNormalized =
$rawData;
foreach ($defaults as $key =>
$value) { if (\
array_key_exists($key,
$rawData)) { continue;
}