Returns true if route is unique.

@param RouteInterface $route

@return bool
339462
private function isUnique(RouteInterface $route)
    {
        $persistedRoute = $this->routeRepository->findByPath($route->getPath(), $route->getLocale());

        return !$persistedRoute;
    }
344509
private function isParameterisedMatch(array $route)
    {
        // Find out if the route has parameters
        if (!preg_match('/\{[a-z]+\}/i', $route['path'])) {
            return false;
        }

        $routePieces = explode('/', $route['path']);
        $urlPieces = explode('/', $this->path);
        if (count($routePieces) != count($urlPieces)) {
            return false;
        }

        $params = array();
        foreach ($routePieces as $routeKey => $routeValue) {
            if (preg_match('/\{[a-z]+\}/i', $routeValue, $matches)) {
                $paramName = trim($routeValue, '{} ');
                $params[$paramName] = urldecode($urlPieces[$routeKey]);
            } else {
                if ($routeValue != $urlPieces[$routeKey]) {
                    return false;
                }
            }
        }

        $route['params'] = array_merge_recursive($route['params'], $params);

        return $route;
    }
1142143
protected function isUnique($id, $url)
    {
        try {
            return $this->loadByUrl($url)->id === $id;
        } catch (NotFoundException $e) {
            return true;
        }
    }
1108988
public function checkRoute($routeNames)
    {
        if (!$this->route) {
            return false;
        }

        $routeName = $this->route->getName();

        if (in_array($routeName, (array)$routeNames)) {
            return true;
        }

        return false;
    }
387990
private function authenticateRoute(Route $route) {

		$auth = $route->getAuth();

		// authentication required?

		if(is_null($auth)) {

			return true;

		}

		if(!$this->authenticator) {
			
			$this->authenticator = new DefaultRouteAuthenticator();

		}

		return $this->authenticator->authenticate($route, Application::getInstance()->getCurrentUser());

	}
359798
private function isValidRoute(array $route)
    {
        if (!array_key_exists('path', $route)) {
            return false;
        }

        if (!array_key_exists('view.directRender', $route)) {
            $route['view.directRender'] = false;
        } else {
            if (!is_bool($route['view.directRender'])) {
                return false;
            }
        }

        if (!array_key_exists('view.layout', $route)) {
            $route['view.layout'] = false;
        } else {
            if (!is_string($route['view.layout'])) {
                return false;
            }
        }

        if (!array_key_exists('method', $route)) {
            $route['method'] = 'GET';
        }

        if (!array_key_exists('allow', $route)) {
            $route['allow'] = array();
        }

        if (!array_key_exists('from', $route['allow'])) {
            $route['allow']['from'] = '';
        }

        if (!array_key_exists('roles', $route['allow'])) {
            $route['allow']['roles'] = '';
        }

        $route['method'] = strtoupper($route['method']);

        if (!array_key_exists('params', $route)) {
            $route['params'] = array();
        }

        return $route;
    }
997891
private static function checkDuplicated(Route $route)
    {
        foreach (self::$register as $registeredRoute) {
            if ($registeredRoute->getName() == $route->getName()) {
                return true;
            }
        }

        return false;
    }
443011
public function offsetExists( $offset ) {
		$route_parameters = isset( $this->route()[2] ) ? $this->route()[2] : [];

		return array_key_exists( $offset, $this->all() + $route_parameters );
	}
948657
private function isAllowed(RequestInterface $request, array $route): bool
    {
        $allowed = true;

        if (false === empty($route['methods'])) {
            $allowed = in_array($request->getMethod(), (array)$route['methods']);
        }

        return $allowed;
    }
1242159
public function add( Route $route ){
		$routeId	= $route->getId();
		if( array_key_exists( $routeId, $this->routes ) ){
			throw new \DomainException( sprintf(
				'A route for pattern and method is already registered: %2$s %1$s',
				$route->getPattern(),
				$route->getMethod()
			) );
		}
		$this->routes[$routeId]	= $route;
		return $routeId;
	}
727204
public function matchRoute($userId, $route)
    {
        $groups = $this->getRouteTable($userId, $route);
        
        if (is_array($groups) && count($groups) > 0) {
            return true;
        }

        return false;
    }
1117212
public function gatherRouteMiddleware(Route $route)
    {
        $middleware = array_map(function ($name)
        {
            return $this->resolveMiddleware($name);

        }, $route->gatherMiddleware());

        return Arr::flatten($middleware);
    }
1292771
public static function parse(RouteInterface $route)
    {
        extract(self::transpilePattern($route->getPattern(), false, $route->getConstraints(), $route->getDefaults()));
        $host = self::parseHostVars($route);

        return new RouteContext($staticPath, $expression, $tokens, $host['expression'], $host['tokens']);
    }
816533
private function route_exists() : bool {
		if ( property_exists( $this, 'routes' ) ) {
			return array_key_exists( $this->__method_name, $this->routes );
		}
		return false;
	}
1156465
public function matches(Route $route, Request $request)
    {
        if (call_user_func_array($route->getCondition(), $route->getConditionParameters())) {
            return true;
        }

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

        return $this;
    }
40879
protected function getHandlerForRoute(Route $route, ProtocolInterface $protocol)
    {
        $handlerId = $route->getDefault(Protocol::OPTION_HANDLER);
        if ($handlerId) {
            $handlerId = substr($handlerId, 1);

            return $this->getContainer()->get($handlerId);
        } else {
            return $protocol->getDefaultHandler();
        }
    }