Add the given route to the arrays of routes.

@param Route $route
550633
protected function addToCollections($route)
    {
        $fullUri = $route->getDomain() . $route->getUri();

        $method = null;
        foreach ($route->getMethods() as $method) {
            $this->routes[$method][$fullUri] = $route;
        }

        $this->allRoutes[$method . $fullUri] = $route;
    }
1016944
public function add(Route $route)
    {
        $this->routes[] = $route;

        $this->addLookups($route);

        return $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;
    }
245301
protected function addWhereClausesToRoute($route)
    {
        $route->where(
            array_merge($this->patterns, Arr::get($route->getAction(), 'where', array()))
        );

        return $route;
    }
1127051
protected function addToCollections($route)
	{
		$domainAndUri = $route->domain() . $route->getUri();

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

		$this->allRoutes[$method . $domainAndUri] = $route;
	}
550863
public function appendRoute(Route $route)
    {
        if (!$originalRoute = optional($this->routes)[$route->slug()]) {
            return "Route {$route->slug()} not found";
        }

        return $this->routes[$route->slug()]['groups'] =
            $originalRoute['groups']->merge($route->get()['groups']);
    }
1317389
public static function add(Route $route)
    {
        exception_if(self::checkDuplicated($route), RouteDuplicatedException::class, $route);

        // Create new route for url ended with '/'
        $routeWithoutSlash = $route;
        $routeWithSlash = $route->getWithSlash();

        self::$register[$routeWithoutSlash->getName()] = $routeWithoutSlash;
        self::$register[$routeWithSlash->getName()] = $routeWithSlash;
    }
902811
public function addRoute(Route $route) : ParsedRoute
    {
        $route = $this->applyGroupSettings($route);
        $parsedRoute = $this->parser->parse($route);
        $this->routeCollection->add($parsedRoute);

        return $parsedRoute;
    }
1131491
private function addCustomRoutes()
    {
        foreach (Route::getRoutes() as $route) {
            $this->_router->respond($route['method'], $route['path'], $route['callback']);
        }
    }
42993
public function addRoute(Route $route, $name = null)
    {
        if (null === $name) {
            // used as a flag to know which routes will need a name later
            $name = '_unnamed_route_'.spl_object_hash($route);
        }

        $this->routes[$name] = $route;

        return $this;
    }
661403
public function add(ParsedRoute $route)
    {
        foreach ($route->getMethods() as $method) {
            $this->routes[$method][] = $route;

            if (!empty($route->getName())) {
                $this->namedRoutes[$route->getName()] =& $route;
            }
        }
    }
870592
public function set($route)
    {
        if ($route instanceof Group) {
            foreach ($route->all() as $r)
                $this->routes[] = $r;
        } else  $this->routes[] = $route;
        return  $this;
    }
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;
            }
        }
    }
876134
public function addRoutes($routes = array())
    {
        if (!$this->isRegistered()) {
            $this->registerWordpressAction();
        }

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

        return $this;
    }
1034501
protected function addWhereClausesToRoute( $route )
	{
		$where = isset( $route->getAction()['where'] ) ? $route->getAction()['where'] : [];
		$route->where( array_merge( $this->patterns, $where ) );

		return $route;
	}
1111462
public function addRoute(array $methods, string $route, $handler): void
    {
        if ($methods === []) {
            throw new \InvalidArgumentException('Methods is empty');
        }

        if (\is_callable($handler)) {
            $handler = \Closure::fromCallable($handler);
        } elseif (!\is_array($handler)) {
            throw new \InvalidArgumentException('Handler is not a valid type: ' . \var_export($handler, true));
        }

        $parts = \explode('/', \trim($route, static::SEPARATOR_TRIM));

        if (!isset($parts[1]) && $parts[0] === '') {
            $parts = [];
        }

        $current = &$this->routes;
        foreach ($parts as $v) {
            if ($v[0] === '{' && $v[-1] === '}') {
                $v = \substr($v, 1, -1);
                if (\strpos($v, ':') !== false) {
                    [$name, $regexp] = \explode(':', $v, 2);

                    $regexp = '/^' . $regexp . '$/';
                    if (!isset($current['regexps'][$regexp])) {
                        $current['regexps'][$regexp] = [
                            'children' => [],
                            'regexps' => [],
                            'name' => $name,
                        ];
                    }
                    $current = &$current['regexps'][$regexp];
                } else {
                    if (!isset($current['others'])) {
                        $current['others'] = [
                            'children' => [],
                            'regexps' => [],
                            'name' => $v,
                        ];
                    }
                    $current = &$current['others'];
                }
            } else {
                if (!isset($current['children'][$v])) {
                    $current['children'][$v] = [
                        'children' => [],
                        'regexps' => [],
                    ];
                }
                $current = &$current['children'][$v];
            }
        }

        $current['route'] = $route;

        if (!isset($current['methods'])) {
            $current['methods'] = [];
        }

        foreach ($methods as $v) {
            $current['methods'][\strtoupper($v)] = $handler;
        }
    }