public function matchRoot(&$request)
    {
        // empty means match always.
        if (empty($this->_patterns)) {
            return true;
        }
        $path   = $request->getPathToMatch();
        $method = $request->getMethod();
        foreach ($this->_patterns as $pattern) {
            if ($matched = Matcher::verify($pattern, $path, $method)) {
                if (isset($matched['matched'])) {
                    $request = $request->withPathToMatch($matched['matched'], $matched['trailing']);
                }
                return true;
            }
        }
        return false;
    }