* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) */ namespace PrestaShop\Module\AutoUpgrade\UpgradeTools\Module; use LogicException; class ModuleUnzipperContext { /** @var string */ private $zipFullPath; /** @var string */ private $moduleName; public function __construct(string $zipFullPath, string $moduleName) { $this->zipFullPath = $zipFullPath; $this->moduleName = $moduleName; $this->validate(); } /** * @throws LogicException */ private function validate(): void { if (empty($this->zipFullPath)) { throw new LogicException('Path to zip file is invalid.'); } if (empty($this->moduleName)) { throw new LogicException('Module name is invalid.'); } } public function getZipFullPath(): string { return $this->zipFullPath; } public function getModuleName(): string { return $this->moduleName; } }