@ -176,19 +176,21 @@ class Dispatcher {
public static function invokeMethod($func, array & $params = array()) {
list($class, $method) = $func;
$instance = is_object($class);
switch (count($params)) {
case 0:
return $class::$method();
return ($instance) ? $class->$method() : $class::$method();
case 1:
return $class::$method($params[0]);
return ($instance) ? $class->$method($params[0]) : $class::$method($params[0]);
case 2:
return $class::$method($params[0], $params[1]);
return ($instance) ? $class->$method($params[0], $params[1]) : $class::$method($params[0], $params[1]);
case 3:
return $class::$method($params[0], $params[1], $params[2]);
return ($instance) ? $class->$method($params[0], $params[1], $params[2]) : $class::$method($params[0], $params[1], $params[2]);
case 4:
return $class::$method($params[0], $params[1], $params[2], $params[3]);
return ($instance) ? $class->$method($params[0], $params[1], $params[2], $params[3]) : $class::$method($params[0], $params[1], $params[2], $params[3]);
case 5:
return $class::$method($params[0], $params[1], $params[2], $params[3], $params[4]);
return ($instance) ? $class->$method($params[0], $params[1], $params[2], $params[3], $params[4]) : $class::$method($params[0], $params[1], $params[2], $params[3], $params[4]);
default:
return call_user_func_array($func, $params);
}