Set convetions callable for route.
Convertions allow to freely transform the route’s parameters before passing them to the dispatcher.

@param Route $route
@param array $convertions
11044
protected function setConvertions(Route $route, array $convertions)
    {
        foreach ($convertions as $convertionName => $convertConfig) {
            $obj        = $this->getInstanceHelper($convertConfig);
            $isCallable = is_callable($obj);
            if (!$isCallable && !$obj instanceof ConvertingInterface) {
                $errMsg = sprintf('"%s" must be implemented "%s"', get_class($obj), ConvertingInterface::class);
                throw new Exception\RuntimeException($errMsg);
            }

            $converter = $isCallable ? $obj : [$obj, 'convert'];
            $route->convert($convertionName, $converter);
        }
    }
617208
public static function add($route, $parameters)
    {
        self::$route = $route;
        array_shift($parameters);
        self::$parameters = $parameters;
    }
1308670
public function execute(Routes $routes): void
	{
		$routeCollection = [];

		// Build table rows

		foreach($routes->getRoutes() as $route)
		{
			// Normalize action name

			$action = ($route->getAction() instanceof Closure) ? 'Closure' : $route->getAction();

			// Build table row

			$routeCollection[] =
			[
				$route->getRoute(),
				implode(', ', $route->getMethods()),
				$action,
				implode(', ', $route->getMiddleware()),
				implode(', ', $route->getConstraints()),
				(string) $route->getName(),
			];
		}

		// Draw table

		$headers =
		[
			'<green>Route</green>',
			'<green>Allowed methods</green>',
			'<green>Action</green>',
			'<green>Middleware *</green>',
			'<green>Constraints **</green>',
			'<green>Name</green>',
		];

		$this->table($headers, $routeCollection);

		$this->write('<green>*</green> <faded>Global middleware is not listed.</faded>');
		$this->write('<green>**</green> <faded>Global constraints are not listed.</faded>');
	}
606956
public function addRoutes($routes)
    {
        if (!is_array($routes)) {
            throw new \InvalidArgumentException("Routes must be an array");
        }

        $routes = array_filter($routes, function ($route) {
            return is_a('Route', $route);
        });

        $this->routes = array_merge($this->routes, $routes);
    }
692329
public function group(array $options, Closure $routes): void
	{
		$this->groups[] = $options;

		$routes($this);

		array_pop($this->groups);
	}
695529
public function add(Route $route)
    {
        $this->addRoute($route->methods(), $route->uri(), $route->handler(), $route->name());
    }
1039838
public function SetRoute($Route, $Destination, $Type, $Save = TRUE) {
      $Key = $this->_EncodeRouteKey($Route);
      SaveToConfig('Routes.'.$Key, array($Destination, $Type), $Save);
      $this->_LoadRoutes();
   }
897397
public function addRoutes($routes)
	{
		foreach ($routes as $route) {
			foreach (explode('|', $route[0]) as $method) {
				$this->routes[$method][] = array(
					'pattern' => $route[1],
					'callable' => $route[2]
				);
			}
		}
	}
404763
protected function displayRoutes(array $routes)
    {
        $this->table->setHeaders($this->headers)->setRows($routes);

        $this->table->render($this->getOutput());
    }
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), '/');
    }
647261
protected function addLookups(Route $route)
    {
        $action = $route->getAction();

        if (isset($action['as'])) {
            $this->names[$action['as']] = $route;
        }

        if (isset($action['controller'])) {
            $this->actions[$action['controller']] = $route;
        }
    }
675475
public function dispatch(RouteInterface $route)
    {
        $this->setRoute($route);

        if ($route->hasClosure()) {
            $this->setControllerResult(call_user_func_array(
                $route->getClosure(), $route->getParams()
            ));
        } else {
            $this->dispatchController();
        }

        return $this;
    }
416483
public function setRule($rule, $route)
    {
        $this->rule[$route->getDomain()][$rule][$route->getMethod()] = $route;
    }
1201327
protected function addToCollections($route)
    {
        $domainAndUri = $route->getDomain().$route->uri();

        if ($route->hasCondition() && ! empty($route->getConditionParameters())) {
            $domainAndUri .= serialize($route->getConditionParameters());
        }

        foreach ($route->methods() as $method) {
            $this->routes[$method][$domainAndUri] = $route;
        }

        $this->allRoutes[$method.$domainAndUri] = $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;
        }
    }
128844
public function map(\Yee\Route $route)
    {
        list($groupPattern, $groupMiddleware) = $this->processGroups();

        $route->setPattern($groupPattern . $route->getPattern());
        $this->routes[] = $route;


        foreach ($groupMiddleware as $middleware) {
            $route->setMiddleware($middleware);
        }
    }
676963
public function setRoute($route)
        {
            if (null !== $route && (!is_string($route) || strlen($route) < 1)) {
                throw new Exception(
                    'Invalid argument: $route must be a non-empty string or null'
                );
            }

            $this->_route     = $route;
            $this->_hrefCache = null;

            return $this;
        }