diff --git a/cli.php b/cli.php index c9b5bb1..c13d5f5 100644 --- a/cli.php +++ b/cli.php @@ -161,19 +161,7 @@ $cli->run(); */ // TODO : Manage a parameter in the constructor of the class $r = new $class; - switch (count ($argv)) - { - case 0: $s=$r->$method(); break; - case 1: $s=$r->$method($argv[0]); break; - case 2: $s=$r->$method($argv[0], $argv[1]); break; - case 3: $s=$r->$method($argv[0], $argv[1], $argv[2]); break; - case 4: $s=$r->$method($argv[0], $argv[1], $argv[2], $argv[3]); break; - case 5: $s=$r->$method($argv[0], $argv[1], $argv[2], $argv[3], $argv[4]); - break; - default: - die ("Too much parameter on the method to be used in CLI\n"); - } - + $s = call_user_func_array(array($r, $method), $argv); var_dump ($s); exit; }