Add a route to the array of routes if not already in the array.

@param \Puzzlout\Framework\Core\Route $route
482432
public function addRoute(Route $route) {
        if (!in_array($route, $this->routes)) {
            $this->routes[] = $route;
        }
    }
635793
public function addNamedRoute($name, \Yee\Route $route)
    {
        if ($this->hasNamedRoute($name)) {
            throw new \RuntimeException('Named route already exists with name: ' . $name);
        }
        $this->namedRoutes[(string) $name] = $route;
    }
316467
public function addRoute($route, $eventName, $priority = 50)
    {
        // If the priority isn't existing we add the priority as 
        // a new array.
        if (!isset($this->routes[$priority])) {
            $this->routes[$priority] = array();
            ksort($this->routes);
        }
        
        // If we had the route already registred, return at this point
        if (isset($this->routes[$priority][$route])) {
            return true;
        }
        
        // Add the route and save the new routes array
        $this->routes[$priority][$route] = $eventName;
        $this->saveRoutes();
        
        return true;
    }
405482
public function route($route = null)
    {
        if (null === $route) {
            return $this->route;
        }
        $this->route = $route;

        return $this;
    }
1347982
public function add($name, RouteInterface $route)
    {
        $this->routes[(string) $name] = $route;

        return $this;
    }
10811
private function trackRoute(Route $route)
    {
        return $this->getModel()->newQuery()->firstOrCreate([
            'name'   => $this->getRouteName($route),
            'action' => $route->getActionName(),
        ])->getKey();
    }
253847
protected function mergeController($route)
	{
		$action = $this->mergeWithLastGroup($route->getAction());

		$route->setAction($action);
	}
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;
    }
1330474
private function addRoute($name, array $route)
    {
        extract($this->defaults($route));

        $requirements[RouteCollectionBuilder::K_NAME] = $name;

        $this->builder->addRoute($method, $pattern, $handler, $requirements, $defaults);
    }
1256582
private function buildValidRoute(Route $route): void
    {
        //add to route array the passed uri for param check when call
        $matches = $this->routeMatches;

        //route match and there is a subpattern with action
        if (\count($matches) > 1) {
            //assume that subpattern rapresent action
            $route->action = $matches[1];

            //url clean
            $route->url = \preg_replace('`\([0-9A-Za-z\|]++\)`', $matches[1], $route->url);
        }

        $route->param = $this->buildParam($route);

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

            if (!empty($route->getName())) {
                $this->namedRoutes[$route->getName()] =& $route;
            }
        }
    }
829983
public function setRoutes(array $routes) {

	    foreach($routes as $route) {

	        if(!$route instanceof Route) {
	            throw new \InvalidArgumentException(sprintf("'%s' is not a Route instance.", $route));
            }

            $this->addRoute($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;
        }
    }
200067
private function addRoutes(array $routes)
    {
        foreach ($routes as $name => $route) {
            if (isset($route['resources'])) {
                $this->loadImports(is_array($route['resources']) ? $route['resources'] :
                (is_string($route['resources']) ? [$route['resources']] : []));
                continue;
            }

            if ((bool)$gkeys = $this->getGroupKeys($route)) {
                $req = isset($route['requirements']) ? $route['requirements'] : [];

                if (null === $prefix = isset($route['pattern']) ? $route['pattern'] : $name) {
                    continue;
                }

                foreach ($gkeys as $i) {
                    $this->loadGroup($prefix, $req, $route[$i]);
                }
                continue;
            }

            $this->addRoute($name, $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;
	}
1054500
public function addRoute(RouteInterface $route)
    {
        foreach ($this->middlewares as $m) {
            $route->addMiddleware($m);
        }
        $this->routes[] = $route;
        return $this;
    }
1014070
public function addRoute($expression, $route)
    {
        //Detect command expression
        if (strpos($expression, '*') !== false) {
            return $this->addRegexpRoute($expression, $route);
        } else {
            return $this->addSimpleRoute($expression, $route);
        }
    }