Vytvori routy
@param IRouter $routes
@param string $url
14984
public function createRoute(IRouter $routes, string $url): void
	{
		$this->createPageRoute($routes, $url);
		$this->createDefaultPageRoutes($routes, $url);
	}
912227
public function addRoutes(array $routes)
    {
        /** @var Route[] $routesTranform */
        $routesTranform = [];

        foreach ($routes as $name => $route) {
            if (is_string($route)) {
                $routesTranform[$name] = new Route($route);
            } elseif ($route instanceof Group) {
                $routesTranform = array_merge($routesTranform, $this->addGroup($route));
            } else {
                $routesTranform[$name] = $route;
            }
        }

        foreach ($routesTranform as $name => $route) {
            if (!$route->getName() && !$route->getResponseCode()) {
                $route->setName($name);
            }

            if (!$route instanceof Route) {
                throw new \InvalidArgumentException(sprintf(
                    'Invalid route, got %s',
                    is_object($route) ? get_class($route) : gettype($route)
                ));
            }

            if (!$route->getName() && !$route->getResponseCode()) {
                throw new \InvalidArgumentException('Missing route name');
            }

            if (isset($this->routes[$route->getName()])) {
                throw new \InvalidArgumentException(sprintf("Duplicate route name '%s'", $route->getName()));
            }

            if ($route->getResponseCode()) {
                $this->errors[$route->getResponseCode()] = $route;
            } else {
                $this->routes[$route->getName()] = $route;
            }
        }
    }
2308
public static function map(
		string $url = null, string $destination, string $route_name = null, string $method = null
	) :Route {
		// We cannot allow duplicate route names for reversing reasons
		if($route_name && self::hasRoute($route_name)) {
			// throw an exception
			throw new Exception("Router::map() The route {$route_name} has already been declared");
		}
		// create a new route
		$route = new Route($route_name);
		// configure the route
		$route
			->setUrl($url)
			->setDestination($destination)
			->setMethod($method);
		// add it to the list of known routes
		self::$_routes[$route->name] = $route;
		// return the route for finer tuning
		return self::$_routes[$route->name];
	}
400690
public function redirectToRoute($route, array $params = [], $permanent = false)
    {
        $map = $this->app()->getRouteMap();
        $url = $map->assemble($route, $params);

        return $this->redirect($url, $permanent);
    }
700206
private function addRoutes(FastRoute\RouteCollector $route) : void
    {
        $routeIndex=0;
        foreach ($this->routes as $definedRoute) {
            $definedRoute[3] = $definedRoute[3] ?? $this->defaultReturnType;
            $routeName = 'routeClosure'.$routeIndex;
            $route->addRoute(strtoupper($definedRoute[0]), $definedRoute[1], $routeName);
            $routeIndex++;
        }
    }
595572
public void withRoutes(MangooRoute... routes) {
        Objects.requireNonNull(routes, Required.ROUTE.toString());
        
        for (MangooRoute route : routes) {
            RequestRoute requestRoute = (RequestRoute) route;
            requestRoute.withControllerClass(this.controllerClass);

            if (hasBasicAuthentication()) {
                requestRoute.withBasicAuthentication(this.username, this.password, this.secret);
            }
            
            if (hasAuthentication()) {
                requestRoute.withAuthentication();
            }
            
            if (hasAuthorization()) {
                requestRoute.withAuthorization();
            }
            
            if (hasBlocking()) {
                requestRoute.withNonBlocking();
            }
            
            if (requestRoute.getLimit() == 0) {
                requestRoute.withRequestLimit(this.limit);
            }
            
            if (requestRoute.hasMultipleMethods()) {
                for (Http method : requestRoute.getMethods()) {
                    requestRoute.withHttpMethod(method);
                    Router.addRoute(requestRoute);
                }
            } else {
                Router.addRoute(requestRoute);
            }
        }
    }
186145
public function invoke(IRoute $route, IContainer $container) {
        return $container->call(
            $route->getAction(), $route->getParameters()
        );
    }
589916
public function access($route, $rules = array(), $redirect = array()) {
		$this->routes[] = Permit::access($route, $rules, $redirect);
	}
805496
protected function checkRoutesStructureValidity(array $routes): void
    {
        $requiredRouteParams = ['alias', 'parameters'];
        foreach ($routes as $routeKey => $route) {
            foreach ($requiredRouteParams as $requiredRouteParam) {
                if (! in_array($requiredRouteParam, array_keys($route))) {
                    throw new ErrorException(
                        'The « ' . $requiredRouteParam . ' » key is missing from the « ' . $routeKey
                        . ' » route definition. Each route key must contain an array with a (string) '
                        . '« alias » key and a (array) « parameters » value. Check the following example : '
                        . '["index" => ["alias" => "news.index","parameters" => []]. '
                        . 'Fix your routes declaration in the « setRoutes() » method.'
                    );
                }
            }
        }
    }
586894
protected function matchRoute(array $routes, $method, IUrl $url) {
        foreach ($routes as $route) {
            if ($this->compareRouteToMethod($route, $method) &&
                $this->getUrlMatcher()->match($route->getPath(), $url->getPath()) &&
                $this->getRestrictionsMatcher()->match($url)
            ) {
                $parameters = $this->getUrlMatcher()
                    ->parse($route->getPath(), $url->getPath());

                $route->setParameters($parameters->toArray());

                return $route;
            }
        }

        return null;
    }
811207
protected function newRoute($methods, $uri, $action)
    {
        return with(new Route($methods, $uri, $action))
            ->setRouter($this)
            ->setContainer($this->container);
    }
844216
public function setRoutes(RouteCollection $routes)
    {
        foreach ($routes as $route) {
            $route->setContainer($this->container);
        }
        $this->routes = $routes;
        $this->container->instance('routes', $this->routes);
    }
826980
private static function extractAttributesFromRoutes($url, $routes)
    {
        $attributes = [];

        foreach ($routes as $route) {
            /**
             * @var  \Illuminate\Routing\Route  $route
             * @var  \Illuminate\Http\Request   $request
             */
            $request = Request::create(implode('/', $url));

            if ( ! $route->matches($request))
                continue;

            $match = self::hasAttributesFromUriPath($url, $route->uri(), $attributes);

            if ($match)
                break;
        }

        return $attributes;
    }
27691
private function getMatchingRoutes( string $uri, $routes ) : array
	{
		$router = new OptionsRouter( $routes );

		return $router->findMatchingRoutes( $uri );
	}
715059
public function setRoutes(array $routes, $replace = false)
    {
        if ($replace) {
            $this->_data = [];
        }
        //dodaje routy z tablicy
        foreach ($routes as $route) {
            /* @var $route \Mmi\Mvc\RouterConfigRoute */
            $this->addRoute($route);
        }
        return $this;
    }
1069147
public function tryRouteForUrl(\Mmi\Mvc\RouterConfigRoute $route, $url)
    {
        $params = [];
        $matches = [];
        $matched = false;
        //sprawdzenie statyczne
        if ($route->pattern == $url) {
            return [
                'matched' => true,
                'params' => array_merge($route->default, $route->replace),
                'url' => trim(substr($url, strlen($route->pattern)), ' /')
            ];
        }
        //dopasowanie wyrażeniem regularnym
        if ($this->_isPatternRegular($route->pattern) && preg_match($route->pattern, $url, $matches)) {
            $this->_tmpMatches = $matches;
            $this->_tmpDefault = $route->default;
            $matched = true;
            foreach ($route->replace as $key => $value) {
                $this->_tmpKey = $key;
                $params[$key] = preg_replace_callback('/\$([0-9]+)/', ['\Mmi\Mvc\RouterMatcher', '_routeMatch'], $value);
                $params[$key] = preg_replace('/\|[a-z]+/', '', $params[$key]);
            }
            $url = trim(substr($url, strlen($matches[0])), ' /');
        }
        return [
            'matched' => $matched,
            'params' => $params,
            'url' => $url
        ];
    }
1029438
final protected function redirectToRoute($route)
    {
        $url = $this->urlBuilder->build($route);

        if ($url !== null) {
            $this->response->redirect($url);
        } else {
            throw new RuntimeException(sprintf('Unknown route supplied for redirection "%s"', $route));
        }
    }