src/UploadedFile.php
public static function parseUploadedFiles(array $uploadedFiles): array
    {
        if (!function_exists(__NAMESPACE__ . '\createUploadedFileObj')) {
            function createUploadedFileObj($array)
            {
                $result = [];

                foreach ($array as $key => $value) {
                    if (is_array($value)) {
                        $result[$key] = createUploadedFileObj($value);
                        continue;
                    }

                    if ($array['error'] && $array['error'] == 4) {
                        continue;
                    }

                    return new UploadedFile($array['tmp_name'],
                                            $array['name'] ?: '',
                                            $array['type'] ?: '',
                                            $array['size'] ?: 0,
                                            $array['error'] ?: 0);
                }

                return $result;
            }
        }

        // Result
        $normalized = self::sanitizeFileData($uploadedFiles);
        $result = createUploadedFileObj($normalized);
        if (is_array($result)) {
            return $result;
        }

        return [];
    }
public static function parseUploadedFiles(array $uploadedFiles): array
    {
        if (!function_exists(__NAMESPACE__ . '\createUploadedFileObj')) {
            function createUploadedFileObj($array)
            {
                $result = [];

                foreach ($array as $key => $value) {
                    if (is_array($value)) {
                        $result[$key] = createUploadedFileObj($value);
                        continue;
                    }

                    if ($array['error'] && $array['error'] == 4) {
                        continue;
                    }

                    return new UploadedFile($array['tmp_name'],
                                            $array['name'] ?: '',
                                            $array['type'] ?: '',
                                            $array['size'] ?: 0,
                                            $array['error'] ?: 0);
                }

                return $result;
            }
        }

        // Result
        $normalized = self::sanitizeFileData($uploadedFiles);
        $result = createUploadedFileObj($normalized);
        if (is_array($result)) {
            return $result;
        }

        return [];
    }
Parse uploaded files from $_FILES PHP environment variable

@param array $uploadedFiles $_FILES value

@return array Multi dimensional \Berlioz\Http\Message\UploadedFile array