Set single route

@param   array $methods Method of received query
@param   string $regexp Regular expression
@param   callable|string $callable Class name or callback
@return  RouteInterface
350363
public function setRoute(array $methods, string $regexp, $callable): RouteInterface
    {
        return $this
            ->setMethods($methods)
            ->setRegexp($regexp)
            ->setCallback($callable);
    }
784197
public function allowMethod(string $method): Route
    {
        if (!in_array($method, self::$supportedMethods)) {
            throw new UnsupportedMethodException($method);
        }

        $this->methods[] = $method;

        return $this;
    }
1026308
public function map($method, $match, $callback)
    {
        $match = $this->base . $match;
        /** @var Route $route */
        $route = $this->routeService
            ->attach($method, $match, $callback)
            ->setGroup($this);
        return $route;
    }
508011
private function mapRoute(string $pattern, callable $callback)
    {
        $word = self::getPattern($pattern);

        $pattern = '/^' . str_replace('/', '\/', $word) . '$/';
        $this->routes[$pattern] = $callback;
    }
184404
public function addPattern(string $name, string $regexp)
    {
        $this->regexp_map = ['/\{(\w+):'.$name.'\}/' => '(?<$1>'.$regexp.')'] + $this->regexp_map;
    }
112065
protected function setMethods($methods): void
    {
        if (\is_string($methods)) {
            $methods = [$methods];
        } elseif (!\is_array($methods)) {
            throw new RouterException('Method invalid');
        }

        foreach ($methods as $method) {
            if (!\in_array($method, Request::$methods, true)) {
                throw new RouterException('Method invalid: ' . $method);
            }
        }

        $this->methods = $methods;
    }
877175
public function method($method = null, $path = '/')
    {
        $parameters = array();

        $parameters['path'] = $path;

        if($method)
            $parameters['method'] = $method;

        $route = $this->factory->createRoute($this, null, $parameters);

        $this->addRoute($route);

        return $route;
    }
1203516
public function match(array $routes, $method, IUrl $url) {
        $route = $this->matchRoute($routes, $method, $url);

        if ($route instanceof IRoute) {
            if ($this->getFiltersMatcher()->applyFilters($route)) {
                $allParametersResolved = $this->getParameterResolver()
                    ->resolveRouteParameters($route);

                if ($allParametersResolved) {
                    return $route;
                }
            }
        }

        if ($method === HttpRequestMethod::HEAD) {
            return $this->match($routes, HttpRequestMethod::GET, $url);
        }

        return null;
    }
435130
public function with(string $param, string $regex): Route{
		$this->params[$param] = str_replace('(', '(?:', $regex);
		return $this;
	}
1061983
protected function createRoute($methods, $pattern, $callable)
    {
        $route = new Route($methods, $pattern, $callable, $this->routeGroups, $this->routeCounter);
        if (!empty($this->container)) {
            $route->setContainer($this->container);
        }

        return $route;
    }
261491
public function add($filterMethod, $regExpUrlMatch, $execute)
    {

        if (!is_array($filterMethod)) {
            $filterMethod = array($filterMethod);
        }

        if (!is_callable($execute) && !$execute instanceof Router) {
            throw new \Exception('The last parameter to Router::add must be a callable function or an instance of the Firelit\Router class');
        }

        $this->routes[] = array(
            'method' => $filterMethod,
            'matcher' => $regExpUrlMatch,
            'function' => $execute
        );
    }
599186
public function register($method, $pattern, $callable)
    {
        /**
         * 判断是否是
         */

        if ($pattern[0] != '|') {
            //非正则表达式的匹配段
            $pattern = $this->groupurl . $pattern;
        }
        $this->router->map($method, $pattern, $callable);
        return $this;
    }
651452
public function matchPath($regexp)
	{
		if (substr($regexp, 0, 1) == '@') {
			$this->route_name = substr($regexp, 1);
		} else {
			parent::matchPath($regexp);
		}
	}
282140
public function query($method, $pattern, $callback)
    {
        $route = new Route($pattern, $callback, $method);
        $this['router']->addRoute($route);

        return $route;
    }
1336620
public function setRegexp($regexp)
	{
		if (is_string($regexp))
		{
			$regexp = new Regexp($regexp);
		}

		$this->vars['regexp'] = $regexp;
		$this->resetSafeness();
		$this->evaluateSafeness();
	}
1003768
protected function createRoute($methods, $pattern, $callable)
	{
		$route = new Route($methods, $pattern, $callable, $this->routeGroups, $this->routeCounter);
		
		return $route;
	}
670118
public function any(string $pattern, $callable): MethodsInterface
    {
        // Set new route with all methods
        $this->set(self::METHODS, [$pattern, $callable]);

        return $this;
    }