Get route by name

@access  public
@param   string  $name   Route name
@return  route
160220
static public function getRoute($name) {
        $route_by_name = isset(self::$_stored_names[$name]) ?
            self::$_stored_names[$name] :
            null;
        
        if (!is_null($route_by_name) && isset(self::$_stored_routes[$route_by_name])) {
            return self::$_stored_routes[$route_by_name];
        }

        return null;
    }
279598
public function getRoute(string $name = null, ...$args)
    {
        if (is_null($name)) {
            return $this->get('route');
        }

        return $this->get('route', $name, ...$args);
    }
623271
public function getPath($name)
    {
        return \array_key_exists($name, $this->paths) ? $this->paths[$name] : null;
    }
772169
public function filterByPrefixName($name)
    {
        return $this->filter(function (Route $route) use ($name)
        {
            return strpos($route->getName(), $name) === 0;
        });
    }
992486
public function getByName($name)
    {
        if (!isset($this->nameMap[$name])) {
            return null;
        }

        return $this->get($this->nameMap[$name]);
    }
1325947
public static function get($name)
    {
        if ( ! isset(Route::$routeInstances[$name]))
        {
            Base::getLog()->error(__METHOD__ . ' getting unknown route', [
                'name'   => $name,
                'exists' => array_keys(self::$routeInstances),
            ]);
            throw new RouteNotFoundException('The requested route does not exist: :route', [
                ':route' => $name
            ]);
        }

        return Route::$routeInstances[$name];
    }
1116737
public static function url($name, $parameters = []) {
		return URequest::getUrl ( self::getRouteByName ( $name, $parameters, false ) );
	}
682132
public function getProviderGatewayByName($name)
    {
        foreach ($this->providerGateways as $provider) {
            if ($provider->getName() === $name) {
                return $provider;
            }
        }

        return null;
    }
1317905
public function findRoute($name)
    {
        if(isset($this->routes[$name]))
            return $this->routes[$name];

        // alias check
        if(isset($this->aliasIndices[$name])) {
            $name = $this->aliasIndices[$name];
        } else {
            foreach($this->groupAliasIndices as $alias => $routeName) {
                if(strpos($name, $alias) === 0) {
                    $name = substr_replace($name, $routeName, 0, strlen($alias));
                    break;
                }
            }
        }

        if($route = $this->findRouteRecursively($name))
            return $this->routes[$name] = $route;

        return false;
    }
136802
private function getRoute(string $routeName): Route
    {
        foreach ($this->router->getRouteCollection() as $name => $route) {
            if ($routeName === $name) {
                return $route;
            }
        }

        throw new RuntimeException(sprintf('The route "%s" does not exist.', $routeName));
    }
185478
protected function getTranslationName($name)
    {
        $name = $this->getRouteName($name);
        $name = array_last(explode('.', $name));

        return $name;
    }
1286421
protected function getInstance($name)
    {
        $route = &$this->routes[$name];

        if (null === $route['instance']) {
            $route['instance'] = $this->routeManager->build(
                !isset($route['options']['type']) ? 'Generic' : $route['options']['type'],
                $route['options']
            );
        }

        return $route['instance'];
    }
1306104
public function getNamedRoute(string $name): Route
    {
        foreach ($this->getRoutes() as $route) {
            if ($route->getName() === $name) {
                return $route;
            }
        }

        throw new InvalidArgumentException('Named route does not exist for name: ' . $name);
    }
947258
public function get(string $name){
        foreach($this->routes as $route){
			if($route->matchName($name))
				return $route;
		}
		return null;
    }
642341
public static function getRouter($name = null, array $options = array())
    {
        if (!isset($name))
        {
            $app  = \JFactory::getApplication();
            $name = $app->getName();
        }

        try
        {
            $router = \JRouter::getInstance($name, $options);
        }
        catch (\Exception $e)
        {
            return null;
        }

        return $router;
    }
404324
public function get($name)
    {
        if (!isset($this->routes[$name])) {
            throw new \DomainException('Route does not exist!');
        }

        return $this->routes[$name];
    }
873205
public static function getHandlerByName($name)
    {
        return isset(self::$namedRoutes[$name]) ? self::$namedRoutes[$name][1] : null;
    }