files) && empty($this->url), Quit::class, 'Must have either a valid file or URL' ); return $this; } public function hasURL(): bool { return !empty($this->url); } public function setInput(?array $files): void { $this->setFiles($files); } public function setFiles(?array $files): void { $this->files = array_map(function (string $file) { if (!file_exists($file)) { throw new Quit("$file is not a valid file"); } return realpath($file); }, $files ?? []); } public function setDestination(?string $dir): void { throw_if(!is_dir($dir), Quit::class, "$dir is not a valid directory"); $this->destination = $dir; // @todo get title from .nfo file, if available } }