public static function fromString($query, $urlEncoding = true)
    {
        static $qp;
        if (!$qp) {
            $qp = new QueryParser();
        }

        $q = new static();

        if ($urlEncoding !== true) {
            $q->setEncodingType($urlEncoding);
        }

        $qp->parseInto($q, $query, $urlEncoding);

        return $q;
    }