src/ItemCollectors/RouteCollector.php
protected function handle(string $path, callable $action, $method, string $name = null): HttpRoute
    {
        if (!is_array($method)) {
            $method = [$method];
        }
        /** @var HttpRoute $route */
        $route = $this->data->createRoute($this->prefix . $path, $action, $name);
        $route->method(...$method);
        return $route;
    }
protected function handle(string $path, callable $action, $method, string $name = null): HttpRoute
    {
        if (!is_array($method)) {
            $method = [$method];
        }
        /** @var HttpRoute $route */
        $route = $this->data->createRoute($this->prefix . $path, $action, $name);
        $route->method(...$method);
        return $route;
    }
protected function handle ( string $ path , callable $ action , $ method , string $ name = null ) : HttpRoute { if ( ! is_array ( $ method ) ) { $ method = [ $ method ] ; } /** @var HttpRoute $route */ $ route = $ this -> data -> createRoute ( $ this -> prefix . $ path , $ action , $ name ) ; $ route -> method ( ... $ method ) ; return $ route ; }
Defines a new route

@param   string $path The path to match
@param   callable $action An action that will be executed
@param   string|array $method Request's method
@param   string $name (optional) Route name

@return  HttpRoute
Defines a new route