Adds a method & route to the to the route map.

@param string $method
@param string $route
@param callable $callable
181085
private function add(string $method, string $route, callable $callable)
	{
		$entry = (object)[
			'route' => $route,
			'pattern' => $this->createPattern($route),
			'callable' => $callable
		];

		if (!array_key_exists($method, $this->routes)) {
			$this->routes[$method] = [];
		}

		$this->routes[$method][] = $entry;
	}
533784
public function add(string $path, $callable): Route{
		$route = new Route($path, $callable);
		$this->routes[] = $route;
		return $route;
	}
734552
protected function callableWithRoute(callable $callable)/*# : bool */
    {
        /* @var EventCapableAbstract $route */
        $route = $this->result->getRoute();
        $param = ['result' => $this->result];
        if ($route->trigger(Route::EVENT_BEFORE_HANDLER, $param)) {
            call_user_func($callable, $this->result);
            $route->trigger(Route::EVENT_AFTER_HANDLER, $param);
            return true;
        }
        $this->result->setHandler(null);
        return false;
    }
331999
public function add($route, $callable, $type = 'any')
    {
        // Check if the route ends with a forward slash
        if ($route && substr($route, -1) !== '/') {
            $route .= '/';
        }

        // Add the route
        $this->routes[strtolower($type)][$route] = $callable;
        return $this;
    }
282670
protected function callController($callable, Request $request)
    {
        list($class, $action) = explode('@', $callable[0], 2);

        // Make sure any route parts are available as query parameters from the request.
        $request->query->add($callable[1]);

        $controller = $this->factory->make($class);
        $controller->setRequest($request);

        return $controller->call($action);
    }
1083348
private function addMethod(string $method): void
    {
        if (!HttpMethod::isValid($method)) {
            throw new \InvalidArgumentException("Invalid HTTP request method '$method'");
        }

        $this->methods[] = $method;
    }
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;
    }
485250
protected function storeRoute(array $methods, array $route)
    {
        $this->callbacks[] = (object)$route;
        $index             = count($this->callbacks) - 1;

        if (!isset($this->routes[$route['pattern']])) {
            $this->routes[$route['pattern']] = [];
        }

        if ($route['name']) {
            $this->names[$route['name']] = $index;
        }

        foreach ($methods as $method) {
            $this->routes[$route['pattern']][strtoupper($method)] = $index;
        }
    }
207765
public function map($method, $route, $handler)
    {
        $this['router']->map($method, $route, $handler);

        return $this;
    }
439195
protected function call($instance, $route, $method)
    {
        $parameters = $this->resolveClassMethodDependencies(
            $route->parametersWithoutNulls(), $instance, $method
        );

        if ($this->creator && method_exists($this->creator, 'modifyMethodParameters')) {
            $this->creator->modifyMethodParameters($instance, $method, $parameters);
        }

        return $instance->callAction($method, $parameters);
    }
1003768
protected function createRoute($methods, $pattern, $callable)
	{
		$route = new Route($methods, $pattern, $callable, $this->routeGroups, $this->routeCounter);
		
		return $route;
	}
506967
private function executeRoute(Route &$route, $method, $force = false)
    {
        $continue = true;
        if (! $force) {
            $continue = $this->executeRouteMiddleware($route, 'before', $method);
        }

        if ($continue === true) {
            $route->execute($this->compiled);
        }

        if (! $force) {
            $this->executeRouteMiddleware($route, 'after', $method);
        }
    }
1232886
private function addCallback(string $method, $state) : void
    {
        $state = $this->makeCallable($state);
        $this->actions[$method] = $state;
    }
829210
public function addRoute($method, $path, $action)
    {
        $route = (new Route($this->conditions, $this->container))
            ->setMethods($method)
            ->setPath($path)
            ->setAction($action)
            ->setRouter($this);

        return $this->routes->add($route);
    }
1294149
private function addRoute($method, $uri, $controller, $action)
    {
        // Prefix route uri, concat it and clear
        if (strlen($this->prefixUri) > 0) {
            $uri = $this->prefixUri . $uri;
            $this->prefixUri = '';
        }

        // Compatible: has no namespace
        if (strrpos($controller, '\\', 1) === false) {
            $controller = 'App\\Controllers\\' . $controller;
        }

        $items = $uri ? explode('/', ltrim($uri, '/')) : [];

        $this->routes[] = [
            'method'     => $method,
            'count'      => count($items),
            'controller' => $controller,
            'action'     => $action,
            'params'     => $items,
        ];
    }
63750
public function addMethod($name, callable $method)
    {
        $this->methods[$name] = \Closure::bind($method, $this, $this);

        return $this;
    }
508011
private function mapRoute(string $pattern, callable $callback)
    {
        $word = self::getPattern($pattern);

        $pattern = '/^' . str_replace('/', '\/', $word) . '$/';
        $this->routes[$pattern] = $callback;
    }