checkFilesArray
@param $files
@return bool
187703
protected function checkFilesArray($files)
    {
        if ($files != null && is_array($files) && !empty($files)) {
            foreach ($files as $file) {
                if ($file != null && is_array($file) && !empty($file)) {
                    return true;
                }
            }
        }
        return false;
    }
734121
public function setFiles($files = array())
    {
        if (count($files) === 0) {
            $this->_files = $_FILES;
        } else {
            $this->_files = $files;
        }

        foreach($this->_files as $file => $content) {
            if (!isset($content['error'])) {
                unset($this->_files[$file]);
            }
        }

        return $this;
    }
810472
public function isFile($file)
	{
		$file = Util::normalizePath($file);

		return (bool) $this->adapter->isFile($file);
	}
446163
protected function filter_files( $files ) {
		if ( ! $files ) {
			return null;
		}

		foreach ( $files as $key => $file ) {
			if ( is_array( $file ) ) {
				$files[ $key ] = $this->filter_files( $files[ $key ] );
			}

			if ( empty( $files[ $key ] ) ) {
				unset( $files[ $key ] );
			}
		}

		return $files;
	}
1041069
public function createUploadedFilesFromArray(array $files)
    {
        $uploadedFiles = [];

        if (isset($files['tmp_name']) && ! is_array($files['tmp_name'])) {
            $uploadedFiles[] = $this->createUploadedFile(
                $files['tmp_name'],
                $files['size'],
                $files['error'],
                $files['name'],
                $files['type']
            );
        } elseif (isset($files['tmp_name']) && is_array($files['tmp_name'])) {
            foreach ($files['tmp_name'] as $key => $file) {
                $uploadedFiles[] = $this->createUploadedFile(
                    $file,
                    $files['size'][$key],
                    $files['error'][$key],
                    $files['name'][$key],
                    $files['type'][$key]
                );
            }
        } else {
            foreach ($files as $key => $value) {
                $uploadedFiles[$key] = $this->createUploadedFilesFromArray($value);
            }
        }

        return $uploadedFiles;
    }
214698
public function upload($files = [])
    {
        foreach ($files as $file) {
            $this->storage->putFileAs($this->path, $file, $file->getClientOriginalName());
        }

        return true;
    }
129413
public function deleteFiles(array $files)
    {
        $count = 0;
        try {
            foreach ($files as $file) {
                $this->sevenZip->delEntry($file);
                $count++;
            }
            return $count;
        } catch (Exception $e) {
            throw new Exception('Could not modify archive: '.$e->getMessage(), $e->getCode(), $e);
        }
    }
68887
public function exists($files)
    {
        $maxPathLength = PHP_MAXPATHLEN - 2;

        foreach ($this->toIterable($files) as $file) {
            if (strlen($file) > $maxPathLength) {
                throw new IOException(sprintf('Could not check if file exist because path length exceeds %d characters.', $maxPathLength), 0, null, $file);
            }

            if (!file_exists($file)) {
                return false;
            }
        }

        return true;
    }
1337045
protected function filterFiles($files)
    {
        foreach ($files as $key => $file) {
            if ($file instanceof UploadedFile) {
                continue;
            }

            if (is_array($file)) {
                if (! isset($file['name'])) {
                    $files[$key] = $this->filterFiles($files[$key]);
                } elseif (isset($files[$key]['error']) && $files[$key]['error'] !== 0) {
                    unset($files[$key]);
                }

                continue;
            }

            unset($files[$key]);
        }

        return $files;
    }
1055209
protected function confirmOverwrite(array $files = [])
    {
        if (!$files || $this->option('overwrite')) {
            return true;
        }
        $files = implode("\n - ", $files);
        return $this->confirm(
            "Are you sure you want to overwrite the following files?\n<comment> - {$files}</comment>\n\n"
        );
    }
797266
public function isApplicable(File $file)
    {
        if (empty($this->databoxes) && empty($this->collections)) {
            return true;
        }

        if (null === $file->getCollection()) {
            return true;
        }

        $fileDatabox = $file->getCollection()->get_databox();

        foreach ($this->databoxes as $databox) {
            if ($databox->get_sbas_id() ===
                $fileDatabox->get_sbas_id()) {
                return true;
            }
        }

        foreach ($this->collections as $collection) {
            if ($collection->get_base_id() === $file->getCollection()->get_base_id()) {
                return true;
            }
        }

        return false;
    }
437345
public function loadFiles($files)
    {
        $files = (array) $files;

        $success = true;
        foreach ($files as $file) {

            $this->loadFile($file);
        }
        return true;
    }
477348
final private static function _hasFileKeys(Array $file): Bool
	{
		$valid = true;
		foreach(['error', 'tmp_name', 'type', 'size', 'name'] as $key) {
			if (! array_key_exists($key, $file)) {
				$valid = false;
				break;
			}
		}
		return $valid;
	}
586677
protected function validateUploads(array $files): void
    {
        foreach ($files as $file) {
            if (null === $file) {
                continue;
            }
            if ($file instanceof UploadedFileInterface) {
                $this->validateUpload($file);
            } else {
                $this->validateUploads($file);
            }
        }
    }
167629
public function valid($file_names) {
		$valid = true;
		if(is_array($file_names)) {
			foreach($file_names as $name) {
				if(!$this->_valid($name)) {
					$valid = false;
					break;
				}
			}
		} else {
			$valid = $this->_valid($file_names);
		}
		return $valid;
	}
984969
private function uploadMore(array $files)
    {
        $res = [];
        foreach ($files as $file) {
            $result = $this->uploadOne($file);
            $res[] = $result;
        }
        return $res;
    }
484220
public static function getFirstExistingFileArray($files = [])
    {
        foreach ($files as $file) {
            if (file_exists(\Yii::getAlias($file))) {
                return $file;
            }
        }

        return null;
    }