src/Router.php
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
        ];
    }
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
        ];
    }
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 ] ; }
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.
Add a path for a route .