public function toArray()
    {
        $qs = $this->query instanceof QueryString
            ? $this->query->toString()
            : '';

        return array(
            'scheme'    => $this->scheme,
            'host'      => $this->host,
            'port'      => $this->port,
            'user'      => $this->user,
            'pass'      => $this->pass,
            'path'      => $this->path,
            'basename'  => $this->basename,
            'dirname'   => $this->dirname,
            'extension' => $this->extension,
            'filename'  => $this->filename,
            'query'     => $qs,
            'fragment'  => $this->fragment,
        );
    }