serverHost = $this->host = $host; $this->port = $port; $this->auth = $auth; $this->basicAuth = $basicAuth; } public function host(): string { return $this->host; } public function serverHost(): string { return $this->serverHost; } public function setServerHost($serverHost) { $this->serverHost = $serverHost; } public function auth(): ?string { return $this->auth; } public function basicAuth(): ?string { return $this->basicAuth; } public function port(): int { return intval($this->port); } public function getUrl(string $subdomain): string { $httpProtocol = $this->port() === 443 ? 'https' : 'http'; $host = $this->serverHost(); if ($httpProtocol !== 'https') { $host .= ":{$this->port()}"; } return "{$subdomain}.{$host}"; } }