From f80478f2627f8459cdf64d8bb15272a44fff3758 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 16 Oct 2021 19:06:43 -0400 Subject: [PATCH] Improve argument handling in Core\Worker::add - The argument name made it unclear the first argument is supposed to be a priority number --- src/Core/Worker.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Core/Worker.php b/src/Core/Worker.php index 3519ce3e51..0431c79521 100644 --- a/src/Core/Worker.php +++ b/src/Core/Worker.php @@ -1199,10 +1199,8 @@ class Worker * array $arr * */ - public static function add($cmd) + public static function add(...$args) { - $args = func_get_args(); - if (!count($args)) { return 0; } @@ -1241,6 +1239,8 @@ class Worker 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);