Add a path for a route.

@param string|array|Route|HasRoute $route A route.
@param string[] $pattern Path pattern.
@param int|string $arity Pattern arity, i.e. number of variables. '*'
for variadic.
@param int $priority Path priority.
559117
public function addPath($route, array $pattern, $arity, $priority = 5)
    {
        $route = $this->validate($route);
        $key = $route->__toString() . '[' . $arity . ']';
        if (isset($this->paths[$key])) {
            if ($priority < $this->paths[$key]['priority']) {
                return;
            }
        }
        $this->paths[$key] = [
            'pattern' => $pattern,
            'priority' => $priority
        ];
    }
1003768
protected function createRoute($methods, $pattern, $callable)
	{
		$route = new Route($methods, $pattern, $callable, $this->routeGroups, $this->routeCounter);
		
		return $route;
	}
1199307
public function set($route, array $arguments = array())
    {
        if (!is_array($route)) {

            $pattern = $route;
            $list = $this->getList();

            if (empty($list[$pattern])) {
                throw new OutOfBoundsException("Unknown route pattern $pattern");
            }

            $route = $list[$pattern];
            $route += array('arguments' => array(), 'pattern' => $pattern);
            $route['simple_pattern'] = preg_replace('@\(.*?\)@', '*', $pattern);

            if (!empty($arguments)) {
                $route['arguments'] = array_merge($arguments, $route['arguments']);
            }
        }

        return $this->route = $route;
    }
404892
public function post($pattern, $handler, array $requirements = [], array $defaults = [])
    {
        $this->addRoute('POST', $pattern, $handler, $requirements, $defaults);
    }
1027347
public function addRoute($methods, string $pattern, string $handler)
    {
        if (is_string($methods)) {
            $methods = (array) $methods;
        }

        $methods = array_map('strtoupper', $methods);

        $this->routes[] = [
            $methods,
            $pattern,
            $handler
        ];
    }
48602
public function map($methods, $pattern, $callable)
	{
		$methods = (array) $methods;
		if (!is_string($pattern)) {
			throw new InvalidArgumentException('Route pattern must be a string');
		}
		
		// Prepend parent group pattern(s)
		if ($this->routeGroups) {
			$pattern = $this->processGroups() . $pattern;
		}
		
		// According to RFC methods are defined in uppercase (See RFC 7231)
		$methods = array_map("strtoupper", $methods);
		
		// Add route
		$route = $this->createRoute($methods, $pattern, $callable);
		$this->routes[$route->getIdentifier()] = $route;
		$this->routeCounter++;
		
		return $route;
	}
945968
function Route (pattern, base, fn, options) {
    this.pattern = RoutePattern.fromString(pattern);
    this.options = options || {};
    this.fn = fn;

    if (base) {
        this.extendFrom(base);
    }
}
163568
public function addPath($path, $priority = PriorityQueue::LOW)
    {
        $this->addGlobalPath($path, $priority);

        return $this;
    }
414951
public function callAliasController($pattern, $path, $alias)
    {
        $route = $this->set($pattern, array($pattern, $path, $alias));
        Handler::call($route, null, 'alias', $route['arguments']);
    }
482432
public function addRoute(Route $route) {
        if (!in_array($route, $this->routes)) {
            $this->routes[] = $route;
        }
    }
8932
public function map(array $methods, string $pattern, $callable) : RouteInterface
    {
        $route = $this->getRouter()->map($methods, $pattern, $callable);

        return $route;
    }
1047226
public function add(
        $name,
        $pattern = null,
        array $defaults = [],
        array $requirements = [],
        array $options = [],
        $host = '',
        array $schemes = [],
        array $methods = [],
        $condition = ''
    ) {
        $pattern = $this->baseRoutePattern.'/'.($pattern ?: $name);
        $code = $this->getCode($name);
        $routeName = $this->baseRouteName.'_'.$name;

        if (!isset($defaults['_controller'])) {
            $actionJoiner = false === strpos($this->baseControllerName, '\\') ? ':' : '::';
            if (':' !== $actionJoiner && false !== strpos($this->baseControllerName, ':')) {
                $actionJoiner = ':';
            }

            $defaults['_controller'] = $this->baseControllerName.$actionJoiner.$this->actionify($code);
        }

        if (!isset($defaults['_sonata_admin'])) {
            $defaults['_sonata_admin'] = $this->baseCodeRoute;
        }

        $defaults['_sonata_name'] = $routeName;

        $this->elements[$this->getCode($name)] = static function () use (
            $pattern, $defaults, $requirements, $options, $host, $schemes, $methods, $condition) {
            return new Route($pattern, $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
        };

        return $this;
    }
1149973
private function hasRoute($routePattern, $routeName)
    {
        if (!$routeName) {
            throw new RoutingRuntimeException('Route name is empty!');
        }

        $route = $this->routeManager->findByRoutePattern($routePattern);

        return ((null !== $route) && ($routeName !== $route->getName()));
    }
956673
public function addMap($pattern, $variables = [])
    {
        $route = new Route(null, $pattern, $variables);

        $this->addRoute($route);

        return $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;
            }
        }
    }
755369
public function setHost($pattern, array $defaults = [], array $requirements = [])
    {
        foreach ($this->routes as $route) {
            $route->setHost($pattern);
            $route->addDefaults($defaults);
            $route->addRequirements($requirements);
        }
    }
55322
public function delete($rule, $route = '', array $option = [], array $pattern = [])
    {
        return $this->rule($rule, $route, 'DELETE', $option, $pattern);
    }