_task = $task; } public function build(int $type, string $homedir, array $database_tables, string $destination):string { if(!is_dir($destination)) throw new IOException("The provided destination not exists"); switch($type) { default: throw new IOException("Invalid type provided"); case Vendor::TYPE_CPANEL: $obj = new CPanel($this->_task); break; case Vendor::TYPE_DIRECT_ADMIN: $obj = new DirectAdmin($this->_task); break; } $obj->setPassword(DB_PASSWORD); $obj->setDomain(Wordpress::getSiteDomain()); $obj->setEmailAddress(Helper::getUserEmail()); $obj->setDestination($destination); $obj->setHomedir($homedir); $obj->setDatabaseTables($database_tables); return $obj->build(); } }