@param $method
@param $pattern

@return RouteInterface
489227
public function add($method, $pattern): RouteInterface
    {
        $route = new Route($this, $method);
        $route->setContainer($this->container);
        if (null !== $this->actionClass) {
            $route->setActionClass($this->actionClass);
        }
        if (null !== $this->requestClass) {
            $route->setRequestClass($this->requestClass);
        }
        $route->setPackage($this->getPackage());
        $prefixes = [$this->resourceName];
        if ($this->isSubResourceOfPackage()) {
            # Add package before resource
            array_unshift($prefixes, $this->packageName);
        }
        if ($this->routesPrefix) {
            # Add prefix before resource
            array_unshift($prefixes, $this->routesPrefix);
        }
        $pattern = $this->trailingSlash($pattern);
        $pattern = implode('/', $prefixes) . $pattern;
        $pattern = '/' . ltrim($pattern, '/');
        $route->setPattern($pattern);

        $this->data[] = $route;

        return $route;
    }
642475
public function match(string $query, string $method = null)
    {
        $this->arguments = [];
        $this->methodMatched = null;
        $this->pathMatched = null;

        $matcher = new RouteMatcher();
        $res = $matcher->match(
            $this->mount,
            $this->path,
            $this->getAbsolutePath(),
            $query,
            $this->method,
            $method
        );
        $this->arguments = $matcher->arguments;
        $this->methodMatched = $matcher->methodMatched;
        $this->pathMatched = $matcher->pathMatched;

        return $res;
    }
352716
public function match(string $path, ?string $method, ?string $host): ?RouteInterface{
        if("/" !== mb_substr($path, 0, 1)){
            $path   = "/" . $path;
        }

        $stack      = new \SplStack();

        foreach(array_reverse(explode("/", $path)) as $segment){
            $stack->push($segment);
        }

        return $this->recursionMatch($this->rootNode, $stack, $method, $host);
    }
350363
public function setRoute(array $methods, string $regexp, $callable): RouteInterface
    {
        return $this
            ->setMethods($methods)
            ->setRegexp($regexp)
            ->setCallback($callable);
    }
447332
public function post($pattern, $handler)
    {

        return $this->addRoute(
            new Route([Method::POST], $pattern, $handler)
        );
    }
381360
public function map($pattern, $callable)
    {
        $route = new \Slim\Route($pattern, $callable);
        $this->routes[] = $route;

        return $route;
    }
32731
private function getMethods($pattern = "/^action_/") {
		$methos = get_class_methods($this->class);
		$actions = array();

		foreach ($methos as $methodName) {
			if (preg_match($pattern, $methodName)) {
				array_push($actions, $methodName);
			}
		}
		return $actions;
	}
203075
public function rule($rule, $route, $method = '*', array $option = [], array $pattern = [])
    {
        return $this->group->addRule($rule, $route, $method, $option, $pattern);
    }
349268
public function pattern(string $parameter, string $pattern) : RouteBuilder
    {
        foreach ($this->routes as $route) {
            $route->tokens([
                $parameter => $pattern,
            ]);
        }
        return $this;
    }
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;
    }
730250
protected function dispatchRouter($method, $path)
    {
        $router = $this->container['router'];
        $logger = $this->container['logger'];

        $logger->debug('Router dispatch.', ['method' => $method, 'path' => $path]);

        $router->init();
        $route_info = $router->dispatch($method, $path);

        $handler = null;
        $vars = [];

        switch ($route_info[0]) {
        case RouteDispatcher::NOT_FOUND:
            $logger->debug('Routing failed. Not Found.');
            throw new HttpNotFoundException('404 Not Found');
            break;
        case RouteDispatcher::METHOD_NOT_ALLOWED:
            $logger->debug('Routing failed. Method Not Allowd.');
            throw new HttpMethodNotAllowedException('405 Method Not Allowed');
            break;
        case RouteDispatcher::FOUND:
            $handler = $route_info[1];
            $vars = $route_info[2];
            $logger->debug('Route found.', ['handler' => $handler]);
            break;
        }

        return [$handler, $vars];
    }
526951
public static function getRoute($route, $method=null) {
// 		$routes	= static::getRoutes();
		if( $method ) {
			return isset(static::$routes[$route][$method]) ? static::$routes[$route][$method] : null;
		}
		foreach( static::getKnownMethods() as $method ) {
			if( isset(static::$routes[$route][$method]) ) {
				return static::$routes[$route][$method];
			}
		}
		return null;
	}
1070740
public function addRoute($methods, $pattern, $handler, array $requirements = [], array $defaults = [])
    {
        list ($name, $host, $schemes, $constraints) = $this->parseRequirements(
            $this->extendRequirements($requirements),
            $methods
        );

        $route = new Route(
            $this->prefixPattern($pattern),
            $handler,
            is_array($methods) ? $methods : explode('|', $methods),
            $host,
            $defaults,
            $constraints,
            is_array($schemes) ? $schemes : explode('|', $schemes)
        );

        $this->routes->add($name, $route);
    }
750923
public function addRoute($name, $pattern = null, $variables = [], $method = [], $options = [])
    {
        if ($name instanceof Route) {
            $route = $name;
        } else {
            if (!is_string($pattern)) {
                throw new \InvalidArgumentException('Route pattern should be string');
            }

            $route = new Route($name, $pattern, $variables, $method, $options);
        }

        // Group
        if ($this->group) {
            $pattern = $route->getPattern();
            $pattern = rtrim($this->group, '/') . '/' . ltrim($pattern, '/');
            $route->setPattern($pattern);
        }

        // Add route
        if ($name = $route->getName()) {
            $this->routes[$name] = $route;
        } elseif (!$name || is_numeric($name)) {
            $this->routes[] = $route;
        }

        return $route;
    }
1029789
public function addRoute($pattern, $endpoint) {
        if(is_object($endpoint) && $endpoint instanceof \Fubber\Reactor\EndpointInterface) {
            // All is fine and dandy
        } elseif (is_callable($endpoint)) {
            // Make a CallbackController
            return $this->addRoute($pattern, new CallbackController($endpoint));
        } else {
            $this->notice('Host::addRoute(): Expects a callback or a controller');
            return FALSE;
        }

        $count = substr_count($pattern, '*');

        if ($count === 0) {
            // This is merely a direct route
            $this->extraRoutes[$pattern] = $this->routes[$pattern] = $endpoint;
        } else {
            // Add this route to the $this->searchRoutes and sort it again
            $this->extraRoutes[$pattern] = $endpoint;
            $this->searchRoutes[] = array($pattern, $endpoint);
        }
    }
1008075
public function map($method, $path, $handler)
    {
        $path = sprintf('/%s', ltrim($path, '/'));

        $route = (new Route)->setMethods((array) $method)
        ->setPath($path)->setCallable($handler);

        $this->routes[$path] = $route;

        return $route;
    }
1186881
public function override($pattern, $func, $method, $overrideWith = 'GET')
    {
        /*
         * We will bind static routes to callable
         *
         * closure object
         * @return object
         */
        $callable = function () use ($func) {
            return $this->callStaticRoute($func);
        };

        $requestMethod = $this->request->server->get('REQUEST_METHOD');

        if ($method !== false) {
            if ($requestMethod == $method) {
                $overrideWith = $requestMethod;
            }
        }

        return $this->match($overrideWith, $pattern, $callable);
    }