zip = $zip; $this->files = $files; $this->filePath = $filePath; } /** * Zip. * * @since 3.5.0 * * @throws \RuntimeException In case the zip file cannot be opened */ public function zip(): void { foreach ($this->files as $file) { file_exists($file) && $this->zip->add($file, PCLZIP_OPT_REMOVE_ALL_PATH); } } /** * Zip File Path. * * @since 3.5.0 * * @return string The file path of the zip */ public function path(): string { return $this->filePath; } }