original_string: 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));
          }
      }
code: 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));
          }
      }
code_tokens: 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 ) ) ; } }
docstring: prepare the route to be executed.
  
  @param Route $request
  @param array $params
  
  @return null
docstring_tokens: prepare the route to be executed .