Sets the uploaded files.

@param array $files The uploaded files

@throws \InvalidArgumentException If invalid structure is provided

@return self
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;
    }
759871
public function createUploadedFiles(array $files){
        $instances = [];

        foreach($files as $name => $value){
            if($value instanceof UploadedFileInterface){
                $instances[$name]  = $value;
                continue;
            }

            if(!is_array($value)){
                $class  = UploadedFileInterface::class;

                throw new \InvalidArgumentException(
                    "The file list must be an associative array whose value is"
                    . " an instance of a class implementing {$class} or an array"
                    . " having file information."
                    . " But the value of index A does not apply to them."
                );
            }

            $instances[$name]  = isset($value["error"]) && isset($value["tmp_name"])
                ? $this->createUploadedFileWithNest($value)
                : $this->createUploadedFiles($value)
            ;
        }

        return $instances;
    }
962426
public function verifyFiles(array $files): self
    {
        $arguments = \array_merge($files, $this->getArguments());

        $this->verifyAction($arguments);

        return $this;
    }
730029
public function setMerged(array $files)
    {
        if (!empty($files)) {
            foreach ($files as $_file) {
                $this->addMerged($_file);
            }
        }
        return $this;
    }
565393
protected function setLoaders(array $loaders)
    {
        $this->loaders = array();
        foreach ($loaders as $type=>$loader) {
            if (!$loader instanceof FormulaLoaderInterface) {
                throw new \InvalidArgumentException("Not a valid formula loader with key '${type}'.");
            }
            $this->setLoader($type, $loader);
        }
    }
935349
protected function _assertValidateUploadedFiles(array $uploadedFiles)
    {
        foreach ($uploadedFiles as $file) {
            if (is_array($file)) {
                $this->_assertValidateUploadedFiles($file);
                continue;
            }

            if (! $file instanceof UploadedFileInterface) {
                throw new \InvalidArgumentException('Invalid uploaded files structure');
            }
        }
    }
521615
public function setFiles($files, $checkLastModified = true)
    {
        $this->_groupKey = null;
        if ($checkLastModified) {
            $this->_lastModified = self::getLastModified($files);
        }
        // normalize paths like in /min/f=<paths>
        foreach ($files as $k => $file) {
            if (0 === strpos($file, '//')) {
                $file = substr($file, 2);
            } elseif (0 === strpos($file, '/') || 1 === strpos($file, ':\\')) {
                $file = substr($file, strlen(self::app()->env->getDocRoot()) + 1);
            }
            $file = strtr($file, '\\', '/');
            $files[$k] = $file;
        }
        $this->_filePaths = $files;
    }
1185898
protected function setUploadedFiles(array &$files)
    {
        $isUploadedFiles = ($files === $_FILES);
        
        $this->files =& $files;
        $this->uploadedFiles = $this->groupUploadedFiles($files, null, $isUploadedFiles);
    }
984969
private function uploadMore(array $files)
    {
        $res = [];
        foreach ($files as $file) {
            $result = $this->uploadOne($file);
            $res[] = $result;
        }
        return $res;
    }
780616
public function setItems(array $items) : self {
      foreach ($items as $item) {
        if (!($item instanceof Token)) {
          throw new \InvalidArgumentException('Expect array of tokens. Token[]');
        }
      }

      $this->items = $items;
      $this->rewind();
      return $this;
    }
490661
public static function create(array $file)
    {
        if (!isset($file[ 'tmp_name' ])) {
            throw new \InvalidArgumentException('The tmp_name key is required.');
        }

        return new UploadedFile(
            $file[ 'tmp_name' ],
            isset($file[ 'name' ])
            ? $file[ 'name' ]
            : null,
            isset($file[ 'size' ])
            ? $file[ 'size' ]
            : null,
            isset($file[ 'type' ])
            ? $file[ 'type' ]
            : null,
            isset($file[ 'error' ])
            ? $file[ 'error' ]
            : UPLOAD_ERR_OK
        );
    }
62233
public function mkFile($files)
    {
        foreach ($files as $file) {
            if (!is_file($file)) {
                @mkdir(dirname($file), 0777, true);
                file_put_contents($file, "<?php\n\nreturn [];\n");
            }
        }
    }
1166272
public function setFile($file) {
        if (!file_exists($file) || !is_readable($file)) {
            throw new InvalidArgumentException("The file '{$file}' cannot be opened.");
        }
        $this->file = $file;
        return $this;
    }
619884
public function setFiles($files) {
		$files = $this->parseFiles($files);
		$this->file->setAll($files);
	}
1012564
public function setMetadataDirs(array $dirs)
    {
        foreach ($dirs as $dir) {
            if (!is_dir($dir)) {
                throw new \InvalidArgumentException(sprintf('The directory "%s" does not exist.', $dir));
            }
        }

        $this->metadataDirs = $dirs;

        return $this;
    }
258513
public function setSeeds(array $seeds)
    {
        $invalidSeeds = [];
        foreach ($seeds as $seed) {
            if (!filter_var($seed, FILTER_VALIDATE_URL)) {
                $invalidSeeds[] = $seed;
            }
        }
        if (!empty($invalidSeeds)) {
            throw new \InvalidArgumentException(
                'Some seeds were invalid: ' . implode(',', $invalidSeeds)
            );
        }

        $this->seeds = $seeds;

        return $this;
    }
100769
public function setExtensions( $extensions = array() )
	{
		if( !is_array( $extensions ) )
			throw new InvalidArgumentException( 'Extensions must be given as Array.' );

		$pattern	= "";
		if( count( $extensions ) )
		{
			$extensions	= implode( "|", array_values( $extensions ) );
			$pattern	= '@\.'.$extensions.'$@i';
		}
		$this->pattern	= $pattern;
	}