Dodaje routę do stosu rout
@param \Mmi\Mvc\RouterConfigRoute $route
@return \Mmi\Mvc\RouterConfig
975689
public function addRoute(\Mmi\Mvc\RouterConfigRoute $route)
    {
        $this->_data[$route->name] = $route;
        return $this;
    }
1018928
function create($route) {
        $route->pattern = $this->parser->trimPath($route->pattern);
        return parent::create($route);
    }
662296
public function resolveRouteParameters(IRoute $route) {
        $parameters = $route->getParameters();
        $resolvers = $this->getResolvers();
        $invoker = $this->getParameterResolverInvoker();

        foreach ($parameters as $name => $parameter) {
            $resolver = array_get($resolvers, $name);

            if ($resolver instanceof IRouteResolver) {
                $value = $invoker->invoke($resolver->getResolver(), $parameter);

                if ($value === null) {
                    return false;
                }

                $parameters[$name] = $value;
            }
        }

        $route->setParameters($parameters);

        return true;
    }
879312
public function invoke(IRoute $route, IContainer $container) {
        list($controller, $method) = $this->extractControllerAndMethod(
            $route->getAction()
        );

        $this->ensureClassExists($controller);
        $instance = $container->get($controller);
        $this->ensureMethodExists($instance, $method);

        return $container->callMethod(
            $instance, $method, $route->getParameters()
        );
    }
860270
public function tryRouteForParams(\Mmi\Mvc\RouterConfigRoute $route, array $params)
    {
        $matches = [];
        $matched = [];
        $applied = true;
        $url = '';
        $replace = array_merge($route->default, $route->replace);
        //ustawianie domyślnego kontrolera i akcji, jeśli brak w parametrach
        $params['controller'] = isset($params['controller']) ? $params['controller'] : 'index';
        $params['action'] = isset($params['action']) ? $params['action'] : 'index';
        //ustawianie domyślnego kontrolera i akcji, jeśli brak w roucie
        $replace['controller'] = isset($replace['controller']) ? $replace['controller'] : 'index';
        $replace['action'] = isset($replace['action']) ? $replace['action'] : 'index';
        //iteracja po roucie
        foreach ($replace as $key => $value) {
            if (is_array($value) && isset($params[$key]) && $value == $params[$key]) {
                $matched[$key] = true;
                continue;
            } elseif (is_array($value)) {
                $applied = false;
                $matched = [];
                break;
            }
            if ((preg_match('/\$([0-9]+)(\|[a-z]+)?/', $value, $mt) && isset($params[$key]))) {
                if (!empty($mt) && count($mt) > 2) {
                    $filter = \Mmi\App\FrontController::getInstance()->getView()->getFilter(ucfirst(ltrim($mt[2], '|')));
                    $params[$key] = $filter->filter($params[$key]);
                }
                $matches[$value] = $params[$key];
            } elseif (!isset($params[$key]) || $params[$key] != $value) {
                $applied = false;
                $matched = [];
                break;
            }
            $matched[$key] = true;
        }
        if ($applied) {
            $pattern = str_replace(['\\', '?'], '', trim($route->pattern, '/^$'));
            $url = preg_replace('/(\(.[^\)]+\))/', '(#)', $pattern);
            foreach ($matches as $match) {
                if (is_array($match)) {
                    $match = trim(implode(';', $match), ';');
                }
                $url = preg_replace('/\(\#\)/', $match, $url, 1);
            }
        }
        return [
            'applied' => $applied,
            'matched' => $matched,
            'url' => $url
        ];
    }
2655
public function supports(IRoute $route) {
        list($controller, $method) = $this->extractControllerAndMethod(
            $route->getAction()
        );

        if ($controller !== null && $method !== null) {
            return true;
        }

        return false;
    }
1342711
public function add(Route $route): self
    {
        if ($route->uri === ""
            || $route->method === 0b0
            || $route->action === null) {
            $this->logger->error("Route incomplete. Unable to add");
            $this->logger->debug("Incomplete Route", [$route]);
            throw new Exception\RouteIncompleteException(
                "Retrieved Route is not complete and can not be stored"
            );
        }

        // store default route
        if ($route->isDefault) {
            if ($this->defaultRoute === null) {
                $this->defaultRoute = $route;
            } else {
                $this->logger->debug(
                    "Default route already added to container, skipping add.",
                    ["route" => $route, "storedDefault" => $this->defaultRoute]
                );
            }
        }

        // store 404 route
        if ($route->is404) {
            if ($this->e404Route === null) {
                $this->e404Route = $route;
                $this->logger->info("404 route added to Route Container");
            } else {
                $this->logger->debug(
                    "404 route already added to container, skipping add.",
                    ["route" => $route, "stored404" => $this->e404Route]
                );
            }

            return $this;
        }

        // store route to regular container
        $this->routes[] = $route;

        $this->logger->info(
            "Route successfully added to Container",
            ["uri" => $route->uri]
        );

        return $this;
    }
575721
public function dispatch(Route $route)
    {
        $this->beforeStart();

        return $this->router->dispatch($route, $this->request);
    }
1221427
public function setMethod($route)
		{
			// variables
			$methodUri      = trim(substr($route, strlen($this->route)), '/');
			$segments       = explode(',', $methodUri);

			// properties
			$this->method    = array_shift($segments);

			// return
			return $this;
		}
864199
protected function toRoute($route, $parameters, $absolute)
    {
        $parameters = $this->formatParameters($parameters);

        $domain = $this->getRouteDomain($route, $parameters);

        // Verificar se ainda tem parametros par atraduzir
        $params_orign = $parameters;
        $parameters = [];
        preg_match_all('%\\{(.*?)\\}%', $route->uri(), $params, PREG_PATTERN_ORDER);
        for ($i = 0; $i < count($params[0]); $i++) {
            $key = str_replace('?', '', $params[1][$i]);
            $val = $this->getParameterContext($key);
            if (array_key_exists($key, $params_orign)) {
                $parameters[$key] = $params_orign[$key];
            } elseif (! is_null($val)) {
                $parameters[$key] = $val;
            }
        }

        $uri = $this->addQueryString($this->trimUrl(
            $root = $this->replaceRoot($route, $domain, $parameters),
            $this->replaceRouteParameters($route->uri(), $parameters)
        ), $parameters);

        // Se ainda tiver parametros gerar erro
        if (preg_match('/\{.*?\}/', $uri)) {
            throw UrlGenerationException::forMissingParameters($route);
        }

        $uri = strtr(rawurlencode($uri), $this->dontEncode);

        return $absolute ? $uri : '/' . ltrim(str_replace($root, '', $uri), '/');
    }
387990
private function authenticateRoute(Route $route) {

		$auth = $route->getAuth();

		// authentication required?

		if(is_null($auth)) {

			return true;

		}

		if(!$this->authenticator) {
			
			$this->authenticator = new DefaultRouteAuthenticator();

		}

		return $this->authenticator->authenticate($route, Application::getInstance()->getCurrentUser());

	}
246509
public function map(Route $route)
    {
        $this->routes[$route->init()->getRule()] = $route;

        return $this;
    }
673921
public function addRoute(Route $route)
    {
        $this->routes[$route->getName()] = $route;

        $this->storage[] = $route;

        return $this;
    }
910279
protected function configure(RouteInterface $route): RouteInterface
    {
        if ($route instanceof ContainerizedInterface && !$route->hasContainer()) {
            // isolating route in a given container
            $route = $route->withContainer($this->container);
        }

        return $route->withPrefix($this->basePath);
    }
460049
protected function dispatchRoute(\Parable\Routing\Route $route)
    {
        $this->response->setHttpCode(200);
        $this->hook->trigger(self::HOOK_HTTP_200, $route);

        $dispatcher = \Parable\DI\Container::get(\Parable\Framework\Dispatcher::class);
        $dispatcher->dispatch($route);

        return $this;
    }
724513
public function addRoute(Route $route)
    {
        /**
         * Auto-generate a name from the object's hash
         * This makes it so that we can autogenerate names
         * that ensure duplicate route instances are overridden
         */
        $name = spl_object_hash($route);

        return $this->set($name, $route);
    }
439553
protected function fromRoute(Router\Route $route)
    {
        return $this->newInstance(
            $route->input,
            $route->domain,
            $route->responder
        );
    }