public function getHostWithPort() { if ($this->hasPort() && (!$this->hasDefaultPort() || !$this->isPortDefault())) { return $this->getHost() . ':' . $this->getPort(); } else { return $this->getHost(); } }