7 private array $processedKeys = [];
11 $this->processedKeys = $processedKeys;
16 if (!empty($this->processedKeys))
18 return $this->flattenWithCheckKeys($input);
21 foreach ($input as
$key => $value)
25 $newItems = $this->getFlattenFields($value,
$key);
26 foreach ($newItems as $newKey => $newValue)
28 $input[$newKey] = $newValue;
36 private function flattenWithCheckKeys(
array $input):
array
38 foreach ($input as
$key => $value)
40 if (is_array($value) && in_array(
$key, $this->processedKeys,
true))
42 $newItems = $this->getFlattenFields($value,
$key);
43 foreach ($newItems as $newKey => $newValue)
45 $input[$newKey] = $newValue;
59 $key =
"{$prefix}[{$name}]";
62 array_push(
$result, ...$this->getFlattenFields($value,
$key));