public function port($raw = false)
    {
        $port = $this->port;
        // If not in raw mode and port is not set, figure it out from scheme.
        if (!$raw && $port === null) {
            if ($this->scheme === 'http') {
                $this->port = 80;
            } elseif ($this->scheme === 'https') {
                $this->port = 443;
            }
        }

        return $this->port;
    }