public function getHostPort(): string
    {
        $host = $this->getHost();

        if ($host && $port = $this->getPort()) {
            $host .= ':' . $port;
        }

        return $host;
    }
public function getHostPort(): string
    {
        $host = $this->getHost();

        if ($host && $port = $this->getPort()) {
            $host .= ':' . $port;
        }

        return $host;
    }
public function getHostPort ( ) : string { $ host = $ this -> getHost ( ) ; if ( $ host && $ port = $ this -> getPort ( ) ) { $ host .= ':' . $ port ; } return $ host ; }
Retrieve the host and port component of the URI.

If a port is present, and it is non-standard for the current scheme,
this method MUST return it, along with the host component, as
a string in a fashion akin to the following <host:port>.

If the port is the standard port used with the current scheme, this
method SHOULD return only the host component.

If no port is present, and no scheme is present, this method MUST return
only the host component.

If no port is present, no host is present, and no scheme is present,
this method MUST return an empty string.

If no port is resent, no host is present, and a scheme is present,
this method MUST return an empty string.

if no port is present, a host is present, and a scheme is present,
this method MUST return only the host component.

@return string
Retrieve the host and port component of the URI .