@param string $method
@param string $pattern
@param callable $action

@throws BadRouteException
@throws MethodNotSupportedException

@return Group
334464
public function set($method, $pattern, $action)
    {
        $method   = $this->getValidMethod($method);
        $patterns = $this->parser->parsePattern($pattern);
        $group    = new Group;

        foreach ($patterns as $pattern)
        {
            $route = new Route($this, $method, $pattern, $action);
            $group->setRoute($route);

            if (strpos($pattern, "{") !== false) {
                   $index = $this->getDynamicIndex($method, $pattern);
                   $this->dynamics[$index][$pattern] = $route;
            } else $this->statics[$method][$pattern] = $route;
        }

        return $group;
    }
773714
public function trace($pattern, $action, $name =  null)
    {
        return $this->addRoute(['TRACE'], $pattern, $action, $name);
    }
196280
public function map(array $methods, string $pattern, $callable): MethodsInterface
    {
        // Check if method in allowed list
        $methods = $this->checkMethods($methods);

        // Set new route with parameters
        $this->set($methods, [$pattern, $callable]);

        return $this;
    }
378968
public function map(array $methods, $pattern, $callable)
    {
        $callable = is_string($callable) ? $this->resolveCallable($callable) : $callable;
        if ($callable instanceof Closure) {
            $callable = $callable->bindTo($this);
        }

        $route = $this->container->get('router')->map($methods, $pattern, $callable);
        if (is_callable([$route, 'setContainer'])) {
            $route->setContainer($this->container);
        }

        if (is_callable([$route, 'setOutputBuffering'])) {
            $route->setOutputBuffering($this->container->get('settings')['outputBuffering']);
        }

        return $route;
    }
416683
public static function set($method, $path, $action)
    {
        if (is_array($method)) {
            foreach ($method as $value) {
                self::set($value, $path, $action);
            }
        } else {
            if (is_string($action)) {
                $action = parent::$prefixNS . $action;
            } elseif ($action !== null && !$action instanceof \Closure) {
                return null;
            }

            $method = strtoupper(trim($method));

            $path = parent::$prefixPath . $path;

            if (!isset(parent::$httpRoutes[$path])) {
                parent::$httpRoutes[$path] = array();
            }

            parent::$httpRoutes[$path][$method] = $action;
        }
    }
805234
public function route($method, $pattern, $callable, $conditions)
    {
        //reseta currentGroups para rotas futuras não herdarem seus middlewares
        $this->currentGroup = null;

        $method = strtoupper($method);
        $pattern = $this->validatePath($pattern);
        if (!is_null($this->routePrefix)) {
            $pattern = $this->routePrefix.$pattern;
        }

        $objRoute = new Route($pattern, $callable, $conditions);
        if (!is_null($this->routePrefix)) {
            $objRoute->setGroupPrefix($this->routePrefix);
        }

        $this->routes[$method][] = $objRoute;
        $this->lastRouteMethod = $method;
        return $this;
    }
562306
public function post(string $pattern, callable $callback)
    {
        if ($this->requestMethod === "POST") {
            $this->mapRoute($pattern, $callback);
        }
    }
434835
public function groupAllowed($alias, $pattern, $method = 'all')
    {
        if (isset($this->group[$alias])) {
            return false;
        }

        $rule = $this->group[$alias];
        return $rule->isAllowed($pattern, $method);
    }
713743
public function method(string $method, string $uriPath, callable $handler, array $parameters = []): GroupInterface
    {
        list($middleware, $configurators, $requestFactory, $useGroupFactory, $name) =
            $this->normalizeRouteParameters($parameters);

        $uriPath = $this->normalizeUri($uriPath, $this->hasTrailSlash());

        $route = $this->createRoute($this, $method, $uriPath, $handler)
            ->setUseGroupRequestFactory($useGroupFactory)
            ->setRequestFactory($requestFactory)
            ->setConfigurators($configurators)
            ->setMiddleware($middleware)
            ->setName($name);

        return $this->addRoute($route);
    }
886977
public function create($url, $method, $action)
	{
		return new Route(
			$this->parseUrl($url), 
			$this->parseArguments($url),
			$this->parseMethod($method), 
			$action
		);
	}
424332
public function except($methods, $pattern, $action)
    {
        return $this->match(array_diff(explode(" ", self::HTTP_METHODS), (array) $methods), $pattern, $action);
    }
744839
public function offsetSet($pattern, $value)
    {
        if (empty($pattern)) {
            throw new \BadMethodCallException("Unable to append a Route without a pattern");
        }
        
        $route = $this->createRoute($value);
        parent::offsetSet($pattern, $route);
    }
602125
public function getGroup($method)
    {
        if (isset($this->routes[$method])) {
            return $this->routes[$method];
        }

        throw new RoutingException("Routes group [{$method}] does not exist.");
    }
381220
public function post(string $pattern, $func)
    {
        $method = strtoupper(__FUNCTION__);
        if (is_array($func)) {
            if ($this->isPatternMatches($pattern)) {
                $this->middleware = $func['middleware'];
            }
            $func = end($func);
        }
        if (!$func instanceof \Closure) {
            return $this->override($pattern, $func, false, $method);
        }

        return $this->match($method, $pattern, $func);
    }
917711
public function findByPattern($rulePattern) {
        $logger = $GLOBALS['logger'];
        $path    = 'rules/';
        $request = $this->_remoteServer->get($path);
        $query = $request->getQuery();
        $query->set('pattern',$rulePattern);
        $logger->info(print_r($query,1));
        //$request = $this->_remoteServer->get($path, array(), array('pattern'=>urlencode($rulePattern))); 
        try {
            $response = $request->send();
            if ($response->getStatusCode() !== 200) {
                throw new \Exception('Unable to handle request');
            }
            $rawResponse = $response->getBody('true');
            return $rawResponse;
        } catch (\Exception $e) {
            throw $e; 
        }
        
    }
351064
public function get(string $pattern, callable $callback)
    {
        if ($this->requestMethod === "GET") {
            $this->mapRoute($pattern, $callback);
        }
    }
903581
public function put(string $pattern, callable $callback)
    {
        if ($this->requestMethod === "PUT") {
            $this->mapRoute($pattern, $callback);
        }
    }