Bind request to route
@param  String  $path
@param  \Closure  $callback
@param  Boolean $condition
@return void
770650
public function bind($path, $callback, $condition = true) {

        if (!$condition) return;

        if (!isset($this->routes[$path])) {
            $this->routes[$path] = [];
        }

        // make $this available in closures
        if (\is_object($callback) && $callback instanceof \Closure) {
            $callback = $callback->bindTo($this, $this);
        }

        // autou-register for /route/* also /route
        if (\substr($path, -2) == '/*' && !isset($this->routes[\substr($path, 0, -2)])) {
            $this->bind(\substr($path, 0, -2), $callback, $condition);
        }

        $this->routes[$path] = $callback;
    }
468022
public function put(String $path, Callable $callback) : Route {

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

	}
508011
private function mapRoute(string $pattern, callable $callback)
    {
        $word = self::getPattern($pattern);

        $pattern = '/^' . str_replace('/', '\/', $word) . '$/';
        $this->routes[$pattern] = $callback;
    }
435734
public function model($key, $class, Closure $callback = null)
    {
        $this->bind($key, RouteBinding::forModel($this->container, $class, $callback));
    }
700818
public function endIf(bool $condition, ?callable $callback = null): void
    {
        if ((bool) $condition) {
            $this->end($callback);
        }
    }
1240359
public static function patch($path, $callback)
    {
        self::instance()->addRoute('PATCH', $path, self::callback($callback));
    }
1312714
public function delete($path, $callback)
    {
        Argument::i()
            //argument 1 should be a string
            ->test(1, 'string')
            //argument 2 should be callable
            ->test(2, 'callable');
        
        return $this->route('delete', $path, $callback);
    }
642115
public function route($name, $path, callable $callback)
    {
        // Modifying path from colon parameters /show/:id to bracket parameters /show/{id}
        $path = preg_replace("|(:(\w+))|", '{$2}', $path);

        // if the route is anonymous
        if (!$name) {
            $name = "N".uniqid();
        }

        $map = $this["router"]->getMap();
        $route = $map->route($name, $path, $callback);

        return $route;
    }
393917
public function bindCallback(Closure $callback, $query = null) {
        call_user_func_array($callback, [$this, $query]);

        return $this;
    }
1362228
public function either(Closure $callback) {
        $predicate = new Predicate(self::EITHER);
        $predicate->bindCallback($callback);

        $this->_params[] = $predicate;

        $this->addBinding(null, $predicate);

        return $this;
    }
1282314
public function setConstraint(Closure $callback)
    {
        $this->data            = [];
        $this->loaded          = false;
        $this->queryConstraint = $callback;

        return $this;
    }
5602
public function uasort($callback, $path = '/')
    {
        $value = $this->get($path);
        if (null === $value || !is_array($value)) {
            return;
        }

        uasort($value, $callback);

        $this->set($path, $value);
    }
698937
public function add(RouteConditionInterface $condition, ActionInterface $action, ?string $key = null)
    {
        if (empty($key) || is_numeric($key)) {
            $this->routes[] = compact('condition', 'action');
        } else {
            $this->routes[$key] = compact('condition', 'action');
        }
    }
916776
public static function any( $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( $args[ 'route' ], $args[ 'callback' ] );
	}
24520
public static function delete($path, $callback)
    {
        self::instance()->addRoute('DELETE', $path, self::callback($callback));
    }
302423
public function post(String $path, Callable $callback) : Route {

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

	}
301343
public function map(Closure $callback)
    {
        for ($i = 0; $i < 100; ++$i) {
            $segment = $this->path.'/'.sprintf($this->segmentName, $i);

            if (file_exists($segment)) {
                $dictionary = (array) include $segment;
                $callback($dictionary);
            }
        }
    }