Adds a route to the router.

@param string $route The route.
@param callable $callable The method to execute when this route gets called.
@param string $type The request type to bind this route to.

@return $this The current object.
331999
public function add($route, $callable, $type = 'any')
    {
        // Check if the route ends with a forward slash
        if ($route && substr($route, -1) !== '/') {
            $route .= '/';
        }

        // Add the route
        $this->routes[strtolower($type)][$route] = $callable;
        return $this;
    }
587044
public function delete($path, callable $handler): RouterInterface
    {
        $ruler = $this->createRuler('DELETE', $path);
        return $this->addRuler($ruler, $handler);
    }
564331
private function collectRoute(String $method, String $path, Callable $callback) : Route {

		if(in_array([$path, $method], $this->getRoutes()))
			throw new RouterException('Route already defined.');

		$route = new Route($method, $path, $callback);
		array_push($this->routes, $route);
		return $route;

	}
68276
public static function post( $route = null, $callback = null ) {
		// Make sure that our parameters are what they say they are
		$args = self::smart_parameters( func_get_args() );

		return self::route( 'POST', $args[ 'route' ], $args[ 'callback' ] );
	}
787338
public function group(string $prefix, callable $handler) : RouterInterface {
        $this->setPrefix($prefix);
        $handler($this);
        $this->setPrefix('');
        return $this;
    }
730002
public function addTypePostCallFunction($type, callable $function)
    {

        $this->appendToArrayOrCallForEachAlias($type, function() use ($type, $function){
            $this->tPostCallFunctions[$type][] = $function;
        }, function($target) use ( $function){
            $this->addTypePostCallFunction($target, $function);
        });



    }
468022
public function put(String $path, Callable $callback) : Route {

		return $this->collectRoute('PUT', $path, $callback);

	}
802389
public function addRoute($uri, $callback, $delimiter = Map::DEFAULT_URL_DELIMITER)
    {
        try {
            /**
             * if the uri is empty throw an exception
             */
            if (empty($uri)) {
                throw new RouteException(sprintf(_('There is no Route entered %s'), $uri));
            }

            // class for mapping
            $route = new Map($uri, $callback, $delimiter);
            $this->rootNode->appendToBranch($uri, $route, Map::DEFAULT_URL_DELIMITER);

        } catch (RouteException $e) {
            throw $e;
        }

    }
897397
public function addRoutes($routes)
	{
		foreach ($routes as $route) {
			foreach (explode('|', $route[0]) as $method) {
				$this->routes[$method][] = array(
					'pattern' => $route[1],
					'callable' => $route[2]
				);
			}
		}
	}
850476
public function add($route)
    {
        if (!$route instanceof Route) {
            $route = new Route($route);
        }

        return $this->addRoute($route);
    }
691216
function post($route, callable $controller) {
		if ($this->request->requestMethod() == 'post') {
			$this->any($route, $controller);
		}
	}
1264005
def put(self, route: str(), callback: object()):
        
        self.__set_route('put', {route: callback})
        return RouteMapping
828757
protected function addCallable(
        /*# string */ $type,
        callable $callable,
        /*# string */ $channel,
        /*# int */ $priority,
        /*# string */ $level = ''
    ) {
        $q = &$this->$type;
        $c = strtoupper($channel);

        if (!isset($q[$c])) {
            $q[$c] = new PriorityQueue();
        }

        /* @var PriorityQueue $queue */
        $queue = $q[$c];
        $queue->insert($callable, $priority, $level);

        return $this;
    }
350363
public function setRoute(array $methods, string $regexp, $callable): RouteInterface
    {
        return $this
            ->setMethods($methods)
            ->setRegexp($regexp)
            ->setCallback($callable);
    }
1061983
protected function createRoute($methods, $pattern, $callable)
    {
        $route = new Route($methods, $pattern, $callable, $this->routeGroups, $this->routeCounter);
        if (!empty($this->container)) {
            $route->setContainer($this->container);
        }

        return $route;
    }
1343542
public function put($path, $callable, $name = null) {
		return $this->add($path, $callable, $name, self::HTTP_METHOD_PUT);
	}
1147309
public function route($route, $query = [], $type = MainRouter::TYPE_PATH)
    {
        $this->route = [
            'route' => $route,
            'query' => (array) $query,
            'type' => $type,
        ];

        return $this;
    }