private static function prepare(Route $route, $params)
    {
        static::$current = $route;

        if ($route->getMethod() == 'resource') {
            if ($route->getTarget()['method'] == 'update') {
                $id = $params[0];
                $params[0] = new Request();
                $params[] = $id;
            } elseif ($route->getTarget()['method'] == 'insert') {
                $params[] = new Request();
            }
            self::treatment(call_user_func_array($route->getClosure(), $params));
        } elseif ($route->getMethod() == 'call') {
            $target = $route->getResource()[$route->name]->getTarget();

            self::treatment(call_user_func_array([$target['controller'], $target['method']], $params));
        } else {
            self::treatment(call_user_func_array($route->getClosure(), $params));
        }
    }
private static function prepare(Route $route, $params)
    {
        static::$current = $route;

        if ($route->getMethod() == 'resource') {
            if ($route->getTarget()['method'] == 'update') {
                $id = $params[0];
                $params[0] = new Request();
                $params[] = $id;
            } elseif ($route->getTarget()['method'] == 'insert') {
                $params[] = new Request();
            }
            self::treatment(call_user_func_array($route->getClosure(), $params));
        } elseif ($route->getMethod() == 'call') {
            $target = $route->getResource()[$route->name]->getTarget();

            self::treatment(call_user_func_array([$target['controller'], $target['method']], $params));
        } else {
            self::treatment(call_user_func_array($route->getClosure(), $params));
        }
    }
private static function prepare ( Route $ route , $ params ) { static :: $ current = $ route ; if ( $ route -> getMethod ( ) == 'resource' ) { if ( $ route -> getTarget ( ) [ 'method' ] == 'update' ) { $ id = $ params [ 0 ] ; $ params [ 0 ] = new Request ( ) ; $ params [ ] = $ id ; } elseif ( $ route -> getTarget ( ) [ 'method' ] == 'insert' ) { $ params [ ] = new Request ( ) ; } self :: treatment ( call_user_func_array ( $ route -> getClosure ( ) , $ params ) ) ; } elseif ( $ route -> getMethod ( ) == 'call' ) { $ target = $ route -> getResource ( ) [ $ route -> name ] -> getTarget ( ) ; self :: treatment ( call_user_func_array ( [ $ target [ 'controller' ] , $ target [ 'method' ] ] , $ params ) ) ; } else { self :: treatment ( call_user_func_array ( $ route -> getClosure ( ) , $ params ) ) ; } }
prepare the route to be executed.

@param Route $request
@param array $params

@return null
prepare the route to be executed .