Creates an UploadedFileMap from the $_FILES superglobal.

@param array $files

@return array
1730
public static function createFromFilesGlobal(array $files) : array
    {
        $items = [];
        $files = self::normalizeSuperglobal($files);
        self::buildMap($files, $items);

        return $items;
    }
954029
public function handleFiles(array $files): array
    {
        $this->removeOldFiles();
        $metadata = [];
        foreach ($files as $file) {
            /**@var $file  UploadedFile */
            if ($file->getError() == UPLOAD_ERR_OK) {
                $originalName = $file->getClientOriginalName();
                $extension = $file->getClientOriginalExtension();
                /**@var $newFile  File */
                if ($newFile = $file->move($this->uploadDir, md5(time().basename($originalName)) . '.' . $extension)) {
                    $metadata[$originalName] = [
                        'host_url'    => $this->hostUrl,
                        'path'        => $newFile->getPathname(),
                        'origin_name' => $originalName,
                        'type'        => $newFile->getMimeType(),
                        'size'        => $newFile->getSize(),
                        'extension'   => $extension
                    ];
                } else {
                    throw new FileUploadException('File upload error');
                }
            }
        }

        return $metadata;
    }
126813
public function build(array $files)
    {
        $processed = array();

        foreach ($files as $file) {
            if ($this->parser->supports($file)) {
                $metadata = $this->parser->parse($file);
                $map = $this->buildMap($metadata);

                $processed[$map->getClass()] = $map;
            }
        }

        return $processed;
    }
1371449
public function upload($file) {

        if (is_array($file['name'])) {
            $files = $this->reArrayFiles($file);

            $results = [];

            foreach ($files as $singleFile) {
                $result = $this->uploadSingle($singleFile);

                $results[] = $result;
            }

            return $results;

        } else {

            return Array($this->uploadSingle($file));

        }
    }
240175
private function getFileContents($files)
	{
		$content = '';
		$basePath = $this->basePath;

		array_walk($files,function(&$value, $key) use(&$content, $basePath){
			if(file_exists($basePath.$value))
			$content .= file_get_contents($basePath.$value);
		});
		return $content;
	}
27521
public function multipart(array $data = [], $files = false) {

        if(is_array($files)) {

            foreach($files as $name => $file) {

                $data[$name] = $this->file($file);

            }

        }

        $this->params = $data;

        return $this->header(['Content-Type' => 'multipart/form-data']);
    }
779190
private static function convertUploadedFiles(array $uploadedFiles)
    {
        $files = [];
        foreach ($uploadedFiles as $name => $uploadedFile) {
            if (!is_array($uploadedFile)) {
                $files[$name] = self::convertUploadedFile($uploadedFile);
                continue;
            }

            $files[$name] = [];
            foreach ($uploadedFile as $file) {
                $files[$name][] = self::convertUploadedFile($file);
            }
        }

        return $files;
    }
278642
public static function parseFromArrayUploadedFiles(array $uploadedFiles) : array
    {
        $parsed = [];
        foreach ($uploadedFiles as $field => $uploadedFile) {
            if ($uploadedFile instanceof UploadedFileInterface) {
                $parsed[$field] = $uploadedFile;
                continue;
            }

            if (!is_array($uploadedFile) || !isset($uploadedFile['name'])) {
                continue;
            }
            if (is_array($uploadedFile['name'])) {
                foreach (array_keys($uploadedFile['name']) as $key) {
                    $parsed[$field][$key] = [
                        'name'     => $uploadedFile['name'][$key],
                        'type'     => $uploadedFile['type'][$key],
                        'tmp_name' => $uploadedFile['tmp_name'][$key],
                        'error'    => $uploadedFile['error'][$key],
                        'size'     => $uploadedFile['size'][$key],
                    ];
                    $parsed[$field] = self::parseFromArrayUploadedFiles($parsed[$field]);
                }
            } else {
                $parsed[$field] = new static(
                    $uploadedFile['tmp_name'],
                    $uploadedFile['name']?: null,
                    $uploadedFile['type']?: null,
                    $uploadedFile['size']?: null,
                    $uploadedFile['error']
                );
            }
        }

        return $parsed;
    }
990561
public function createForDocumentation(array $files): array
    {
        if (in_array(Constants::TEST_TYPE_DOCUMENTATION, $this->types)) {
            $definitions = [];
            foreach ($files as $file) {
                $key = $this->getTestGroupNameForDocumentationFile($file);
                $definitions[$key] = $this->collectDefinitionsForFile($file);
            }

            return $definitions;
        }

        return [];
    }
875144
public function handleMultipleFiles(array $files)
    {
        foreach ($files as $file) {
            $this->handleSingleFile($file);
        }
        return $this->getUploadedFilesList();
    }
614607
public function write(array $files)
    {
        $filesystem = $this->getFilesystem($this->field, $this->settings);
        $results = [];
        foreach ($files as $file => $path) {
            $results[] = $this->writeFile($filesystem, $file, $path);
        }

        return $results;
    }
552337
protected function setUploadedFiles(array $files)
    {
        $validate = function ($files) use (&$validate) {
            foreach ($files as $item) {
                if (is_array($item)) {
                    $validate($item);
                    continue;
                }
                if (! $item instanceof UploadedFileInterface) {
                    throw new InvalidArgumentException(
                        'Invalid structure of uploaded files provided.'
                    );
                }
            }
        };
        $validate($files);
        $this->uploadedFiles = $files;

        return $this;
    }
850044
private function loadFiles($files)
    {
        if (is_dir($files)) {
            $directory = realpath($files);
            $files     = [];
            $brains    = glob($directory.'/*.rive');

            foreach ($brains as $brain) {
                $files[] = $brain;
            }

            return $files;
        }

        return (array) $files;
    }
311447
public static function multiple(
        array $files
    ) {
        $out = [];
        foreach ($files as $file) {
            $out[] = static::info($file);
        }

        return $out;
    }
686526
protected function convertUploadedFiles( array $files )
	{
		return array_map( function ( $file )
		{
			if ( is_null( $file ) || ( is_array( $file ) && empty( array_filter( $file ) ) ) )
				return $file;

			return is_array( $file ) ? $this->convertUploadedFiles( $file ) : UploadedFile::createFromBase( $file );
		}, $files );
	}
896249
protected static function normalizeUploadedFiles(array $uploadedFiles)
    {
        $files = [];

        foreach ($uploadedFiles as $key => $value) {

            if ($value instanceof UploadedFileInterface) {

                $files[$key] = $value;

            } elseif (is_array($value) && isset($value['tmp_name'])) {

                $files[$key] = static::createUploadedFileFromSpec($value);

            } elseif (is_array($value)) {
                
                $files[$key]  = static::normalizeUploadedFiles($value);

            } else {

                throw new \InvalidArgumentException('Invalid uploaded files value');
            }
        }

        return $files;
    }
541591
public static function createFromGlobals(array $globals = null) : array
    {
        $globals = $globals === null
            || ! isset($globals[static::GLOBAL_KEY_NAME])
            || ! is_array($globals[static::GLOBAL_KEY_NAME])
            ? (isset($_FILES) ? $_FILES : [])
            : $globals;
        return static::parseFromArrayUploadedFiles($globals);
    }