- The argument name made it unclear the first argument is supposed to be a priority number
- public static function add($cmd)
+ public static function add(...$args)
- $args = func_get_args();
-
if (!count($args)) {
return 0;
}
if (!count($args)) {
return 0;
}
if (isset($run_parameter['force_priority'])) {
$force_priority = $run_parameter['force_priority'];
}
if (isset($run_parameter['force_priority'])) {
$force_priority = $run_parameter['force_priority'];
}
+ } else {
+ throw new \InvalidArgumentException('Priority number or task parameter array expected as first argument');
}
$command = array_shift($args);
}
$command = array_shift($args);