public function offsetGet($offset)
    {
        if (!in_array($offset, self::$parts)) {
            throw new \OutOfBoundsException("$offset is not a valid url part");
        }
        if (isset($this->components[$offset])) {
            $ret = $this->components[$offset];
        } else {
            $ret = '';
        }
        if (is_array($ret) && $offset == self::QUERY) {
            $ret = self::queryString($ret);
        }
        return $ret;
    }