@param IRoute $route

@return mixed
2655
public function supports(IRoute $route) {
        list($controller, $method) = $this->extractControllerAndMethod(
            $route->getAction()
        );

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

        return false;
    }
861046
private function getMethods(Route $route)
    {
        $methods = $route->getMethods();
        sort($methods);

        return implode('|', $methods) ?: 'ANY';
    }
916463
protected function getBeforeFilters($route)
	{
		$before = array_keys($route->beforeFilters());

		$before = array_unique(array_merge($before, $this->getPatternFilters($route)));

		return implode(', ', $before);
	}
782067
protected function getRouter(string $module = null): IRouter
	{
		if ($module !== null) {
			return $this->router[] = new RouteList($module);
		} else {
			return $this->router;
		}
	}
1117212
public function gatherRouteMiddleware(Route $route)
    {
        $middleware = array_map(function ($name)
        {
            return $this->resolveMiddleware($name);

        }, $route->gatherMiddleware());

        return Arr::flatten($middleware);
    }
68167
public function get($route = null)
    {
        //argument 1 must be a string or null
        Argument::i()->test(1, 'string', 'null');
        
        //if route is null
        if (is_null($route)) {
            //return all routes
            return $this->route;
        }
        
        //if valid route
        if ($this->valid($route)) {
            //return route
            return $this->route[strtolower($route)];
        }
        
        //at this point it is not a route
        //return the same thing
        return $route;
    }
1097716
protected function _validateRoute($route)
    {
        // Split on comma.
        $domains = explode(',', trim($route));

        foreach ($domains as $domain) {
            $domain = str_replace('@', '', trim($domain));
            if (!$this->_validateDomain($domain)) return false;
        }

        return $route;
    }
789389
private function getReflectionMethodForRoute(Route $route)
    {
        $class = $this->extractClassFromRoute($route);
        $method = $this->extractFunctionFromRoute($route);

        if ($class !== null && $method !== null) {
            return new \ReflectionMethod($class, $method);
        }
        return null;
    }
740551
private function _getDispatchByRoute($route)
    {
        $pos = strpos($route, '/');
        if ($pos === false) {
            $parts = [$this, $route];
        } elseif ($pos > 0) {
            $parts = $this->module->createController($route);
        } else {
            $parts = Yii::$app->createController($route);
        }
        if (is_array($parts)) {
            /* @var $controller self */
            list($controller, $actionID) = $parts;
            $oldController = Yii::$app->controller;
            Yii::$app->controller = $controller;
        } else {
            throw new InvalidRouteException('Unable to resolve the dispatch request: ' . $route);
        }
        
        $dispatch = $controller->_createDispatch($actionID, false);
        
        if ($oldController !== null) {
            Yii::$app->controller = $oldController;
        }
        
        return $dispatch;
    }
1130551
public static function parseRoute($route)
    {
        if (!empty($route)) {
            $url = [];
            $r = explode('&', $route);
            $url[0] = $r[0];
            unset($r[0]);
            foreach ($r as $part) {
                $part = explode('=', $part);
                $url[$part[0]] = isset($part[1]) ? $part[1] : '';
            }

            return $url;
        }

        return '#';
    }
95874
protected function dispatchBodyClass(Route $route)
    {
        return function ($classes) use ($route) {
            if ($route->hasCondition()) {
                return $classes;
            }

            $tokens = array_filter(array_map(function ($token) use ($route) {
                switch ($type = $token[0]) {
                    case 'variable':
                        if (isset($token[3]) && $route->hasParameter($paramKey = $token[3])) {
                            $param = $route->parameter($paramKey);

                            return is_string($param) ? sprintf('%s-%s', $paramKey, sanitize_title($param)) : false;
                        }

                        return false;
                        break;
                    case 'text':
                        return sanitize_title($token[1]);
                        break;
                    default:
                        return false;
                }
            }, array_reverse($route->getCompiled()->getTokens())));

            if (! empty($tokens)) {
                return array_filter(array_merge($tokens, $classes), function ($class) {
                    return 'error404' !== $class;
                });
            }

            return $classes;
        };
    }
789252
public function gatherRouteMiddlewares(LaravelRoute $route)
    {
        $middlewares = [];

        foreach ($route->middleware() as $name) {
            $middlewares[] = $this->resolveMiddlewareClassName($name);
        }
        return Arr::flatten($middlewares);
    }
226424
private function checkForMetaRoute($route)
    {
        $this->baseRoute = $route;
        $this->metaRoute = null;

        // If route exits in index, use it
        if ($this->mapRoute2IndexKey($route)) {
            return $route;
        }

        // Check for pagination
        $pagination = $this->config["pagination"];
        $matches = [];
        $pattern = "/(.*?)\/($pagination)\/(\d+)$/";
        if (preg_match($pattern, $route, $matches)) {
            $this->baseRoute = $matches[1];
            $this->metaRoute = $route;
            $this->currentPage = $matches[3];
        }

        return $this->baseRoute;
    }
19780
public function getSlug($route, $params = [])
    {
        $dbRoute = Yii::$app->cache->get([$route, $params]);
        if (YII_ENV_DEV || $dbRoute == false) {
            $dbRoute = UrlRule::getRoute($route, $params);
            Yii::$app->cache->set(
                [$route, $params],
                $dbRoute
            );
        }
        return $dbRoute;
    }
82544
protected function callback($route) {
		return function (&...$args) use ($route) {
			// Grab args using function because we don't know the number of args being passed.
			// https://www.php.net/manual/en/functions.arguments.php#functions.variable-arg-list
			// https://wiki.php.net/rfc/variadics
			$route = preg_replace('/[^a-zA-Z0-9_\/]/', '', (string)$route);

			// Keep the original trigger
			$trigger = $route;

			// Trigger the pre events
			$result = $this->registry->get('event')->trigger('model/' . $trigger . '/before', array(&$route, &$args));

			if ($result && !$result instanceof Exception) {
				$output = $result;
			} else {
				$class = 'Model' . preg_replace('/[^a-zA-Z0-9]/', '', substr($route, 0, strrpos($route, '/')));

				// Store the model object
				$key = substr($route, 0, strrpos($route, '/'));

				// Check if the model has already been initialised or not
				if (!$this->registry->has($key)) {
					$object = new $class($this->registry);

					$this->registry->set($key, $object);
				} else {
					$object = $this->registry->get($key);
				}

				$method = substr($route, strrpos($route, '/') + 1);

				$callable = array($object, $method);

				if (is_callable($callable)) {
					$output = call_user_func_array($callable, $args);
				} else {
					throw new \Exception('Error: Could not call model/' . $route . '!');
				}
			}

			// Trigger the post events
			$result = $this->registry->get('event')->trigger('model/' . $trigger . '/after', array(&$route, &$args, &$output));

			if ($result && !$result instanceof Exception) {
				$output = $result;
			}

			return $output;
		};
	}
239588
protected function getProtocolForRoute(Route $route)
    {
        $protocolId = $route->getDefault(Protocol::OPTION_PROTOCOL);
        if (!$protocolId) {
            throw new InvalidConfigurationException(sprintf(
                'Route "%s" has no protocol defined',
                $route->getPath()
            ));
        }

        $protocolId = substr($protocolId, 1);

        return [$protocolId, $this->getContainer()->get($protocolId)];
    }
186145
public function invoke(IRoute $route, IContainer $container) {
        return $container->call(
            $route->getAction(), $route->getParameters()
        );
    }