protected function filterFiles(array $files)
    {
        $filtered = [];
        foreach ($files as $key => $value) {
            if (\is_array($value)) {
                $filtered[$key] = $this->filterFiles($value);
            } elseif ($value instanceof UploadedFile) {
                if ($value->isValid() && $value->getSize() > UploadedFile::getMaxFilesize()) {
                    $filtered[$key] = new UploadedFile(
                        '',
                        $value->getClientOriginalName(),
                        $value->getClientMimeType(),
                        UPLOAD_ERR_INI_SIZE,
                        true
                    );
                } else {
                    $filtered[$key] = new UploadedFile(
                        $value->getPathname(),
                        $value->getClientOriginalName(),
                        $value->getClientMimeType(),
                        $value->getError(),
                        true
                    );
                }
            }
        }

        return $filtered;
    }
protected function filterFiles(array $files)
    {
        $filtered = [];
        foreach ($files as $key => $value) {
            if (\is_array($value)) {
                $filtered[$key] = $this->filterFiles($value);
            } elseif ($value instanceof UploadedFile) {
                if ($value->isValid() && $value->getSize() > UploadedFile::getMaxFilesize()) {
                    $filtered[$key] = new UploadedFile(
                        '',
                        $value->getClientOriginalName(),
                        $value->getClientMimeType(),
                        UPLOAD_ERR_INI_SIZE,
                        true
                    );
                } else {
                    $filtered[$key] = new UploadedFile(
                        $value->getPathname(),
                        $value->getClientOriginalName(),
                        $value->getClientMimeType(),
                        $value->getError(),
                        true
                    );
                }
            }
        }

        return $filtered;
    }
protected function filterFiles ( array $ files ) { $ filtered = [ ] ; foreach ( $ files as $ key => $ value ) { if ( \ is_array ( $ value ) ) { $ filtered [ $ key ] = $ this -> filterFiles ( $ value ) ; } elseif ( $ value instanceof UploadedFile ) { if ( $ value -> isValid ( ) && $ value -> getSize ( ) > UploadedFile :: getMaxFilesize ( ) ) { $ filtered [ $ key ] = new UploadedFile ( '' , $ value -> getClientOriginalName ( ) , $ value -> getClientMimeType ( ) , UPLOAD_ERR_INI_SIZE , true ) ; } else { $ filtered [ $ key ] = new UploadedFile ( $ value -> getPathname ( ) , $ value -> getClientOriginalName ( ) , $ value -> getClientMimeType ( ) , $ value -> getError ( ) , true ) ; } } } return $ filtered ; }
Filters an array of files.

This method created test instances of UploadedFile so that the move()
method can be called on those instances.

If the size of a file is greater than the allowed size (from php.ini) then
an invalid UploadedFile is returned with an error set to UPLOAD_ERR_INI_SIZE.

@see UploadedFile

@return array An array with all uploaded files marked as already moved
Filters an array of files .