Any
@param $route
@param $handler

Set POST|GET route
434730
public function any($route, $handler)
  {
    $this->routesPost[] = new Route($route, $handler, ['ANY']);
    $this->routesGet[] = new Route($route, $handler, ['ANY']);
  }
365342
public function request(string $path, int $methods, $handler)
	{
		$path = $this->currentContext->getPrefixedPath(
			trim($path, "\n\r\t/ ")
		);

		return $this->route(new Route($path, $methods), $handler);
	}
691216
function post($route, callable $controller) {
		if ($this->request->requestMethod() == 'post') {
			$this->any($route, $controller);
		}
	}
622078
public function hook($route)
    {
        $route->setURLHandler([$this,'onURL']); //todo once ?
        
        $route->path_info=$this->adjustPathinfo($route->path_info, $route->document_root);
        $route->calling_path=$route->path_info;
    }
1198959
protected function handle($handler) {
	$handler_type = $this->get_handler_type($handler);
	
	// unmatched requests
	if (empty($handler) || empty($handler_type)) {
		$exception = bootstrap::get_library('exception');
		throw new $exception('no route found', response::STATUS_NOT_FOUND);
	}
	
	// default flow: matched requests
	$this->{'load_handler_as_'.$handler_type}($handler);
}
1165748
public function any(string $url, $callback): Route
    {
        $route = new Route(['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], $url, $callback);
        $this->addRoute($route);

        return $route;
    }
1014341
public function post($route, $handler)
    {
        return $this->addRoute(new Route($this->router, ['POST'], $route, $handler, $this->name));
    }
652976
public function process(Request $request, Handler $handler): Response
    {
        try {
            return $handler->handle($request);
        } catch (ClientException|RouteNotFoundException $e) {
            if ($e instanceof ClientException) {
                $code = $e->getCode();
            } else {
                $code = 404;
            }
        } catch (\Throwable $e) {
            if (!$this->suppressErrors) {
                throw $e;
            }

            if ($this->snapshotter !== null) {
                $this->snapshotter->register($e);
            }

            $code = 500;
        }

        $this->logError($request, $code, $e->getMessage());

        return $this->renderer->renderException($request, $code, $e->getMessage());
    }
1008364
public static function any(string $path, $handler) : array
    {
        return [
            static::get($path, $handler),
            static::post($path, $handler),
            static::put($path, $handler),
            static::patch($path, $handler),
            static::delete($path, $handler),
        ];
    }
521889
public function route(Route $route, $handler) 
	{
		if (!is_callable($handler)) {
			throw new Exception('Route handler must be callable.');
		}

		$this->currentContext->addRoute($route, $handler);
		return $this;
	}
55014
public static function get($route, $handler, $options = [])
    {
        app()->router->get($route, $handler, $options);
    }
160616
public function process(Request $request, Handler $handler): Response
    {
        try {
            $symfonyRequest = (new HttpFoundationFactory())
                ->createRequest($request);
            $this->router->getContext()->fromRequest($symfonyRequest);
            $route = $this->router
                ->matchRequest($symfonyRequest);
        } catch (MethodNotAllowedException $e) {
            $allows = implode(', ', $e->getAllowedMethods());
            return $this->createResponse(405, $e->getMessage())
                    ->withHeader('Allow', $allows);
        } catch (NoConfigurationException $e) {
            return $this->createResponse(500, $e->getMessage());
        } catch (ResourceNotFoundException $e) {
            return $this->createResponse(404, $e->getMessage());
        }

        foreach ($route as $key => $value) {
            $request = $request->withAttribute($key, $value);
        }

        return $handler->handle($request);
    }
1200980
public function options($path, $handler, $info = null)
    {
        $this->addRoute(["OPTIONS"], null, $path, $handler, $info);
    }
544366
protected function register($method, $route, $handler)
    {
        // Protect WordPress root route !
        if ($route == '/') {
            return;
        }

        // If the developer is registering multiple request methods to handle
        // the URI, we'll spin through each method and register the route
        // for each of them along with each URI and handler.

        // TODO : Only put the same method route to route array

        if (is_array($method)) {
            foreach ($method as $http) {
                $routeCollection = new Route($http, $route, new RouteHandler($handler));

                //Add this route to the $routeCollections params
                array_push($this->routeCollections, $routeCollection);
            }

            return;
        }

        // Create routeCollection from params
        $routeCollection = new Route($method, $route, new RouteHandler($handler));

        //Add this route to the $routeCollections params
        array_push($this->routeCollections, $routeCollection);

        return $this->routeCollections[sizeof($this->routeCollections) - 1];
    }
71909
public function any( $uri, $action = null )
	{
		$verbs = ['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE'];

		return $this->addRoute( $verbs, $uri, $action );
	}
680891
public static Router post(final String uriTemplate, final ContextHandler handler) {
        return route().post(uriTemplate, handler);
    }
1049695
public function process(Request $request, Handler $handler): Response
    {
        $method = $request->getMethod();
        $uri = $request->getUri()->getPath() ?: '/';

        $routeInfo = $this->getDispatcher()->dispatch($method, $uri);

        switch ($routeInfo[0]) {
            case Dispatcher::NOT_FOUND:
                throw new RouteNotFoundException($uri);
            case Dispatcher::METHOD_NOT_ALLOWED:
                throw new MethodNotAllowedException($method);
            case Dispatcher::FOUND:
                $handler = $routeInfo[1];
                $parameters = $routeInfo[2];

                return $handler($request, $parameters);
        }
    }