/**
* Converts uploaded files to UploadedFile instances.
*
* @return UploadedFile[]|UploadedFile|null
*/
protected function convertFileInformation(array|UploadedFile
$file): array|UploadedFile|null
{ if ($file instanceof UploadedFile
) { return $file;
} $file =
$this->
fixPhpFilesArray($file);
$keys =
array_keys($file);
sort($keys);
if (self::FILE_KEYS ==
$keys) { if (\UPLOAD_ERR_NO_FILE ==
$file['error'
]) { $file = null;
} else { $file =
new UploadedFile($file['tmp_name'
],
$file['name'
],
$file['type'
],
$file['error'
], false
);
} } else { $file =
array_map(fn ($v) =>
$v instanceof UploadedFile || \
is_array($v) ?
$this->
convertFileInformation($v) :
$v,
$file);