public function authority()
    {
        $userInfo = $this->username;
        if ($this->password) {
            $userInfo .= ':' . $this->password;
        }
        $port      = $this->port();
        $authority = $this->host;
        if ($authority && $userInfo) {
            $authority = $userInfo . '@' . $authority;
        }
        if ($authority && $port) {
            $authority .= ':' . $port;
        }

        return $authority;
    }