src/Valkyrja/HttpMessage/ServerRequestFactory.php
private static function createUploadedFileFromSpec(array $value)
    {
        if (\is_array($value['tmp_name'])) {
            return self::normalizeNestedFileSpec($value);
        }

        return new NativeUploadedFile(
            $value['size'],
            $value['error'],
            $value['tmp_name'],
            null,
            $value['name'],
            $value['type']
        );
    }
private static function createUploadedFileFromSpec(array $value)
    {
        if (\is_array($value['tmp_name'])) {
            return self::normalizeNestedFileSpec($value);
        }

        return new NativeUploadedFile(
            $value['size'],
            $value['error'],
            $value['tmp_name'],
            null,
            $value['name'],
            $value['type']
        );
    }
Create and return an UploadedFile instance from a $_FILES specification.

If the specification represents an array of values, this method will
delegate to normalizeNestedFileSpec() and return that return value.

@param array $value $_FILES struct

@throws \InvalidArgumentException

@return array|UploadedFile