1 | <?php |
||
8 | class AddJob extends BaseCommand implements CommandInterface |
||
9 | { |
||
10 | use ArrayChecker; |
||
11 | use OptionChecker; |
||
12 | |||
13 | /** |
||
14 | * Available command options |
||
15 | * |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $options = [ |
||
19 | 'timeout' => 0, |
||
20 | 'replicate' => null, |
||
21 | 'delay' => null, |
||
22 | 'retry' => null, |
||
23 | 'ttl' => null, |
||
24 | 'maxlen' => null, |
||
25 | 'async' => false |
||
26 | ]; |
||
27 | |||
28 | /** |
||
29 | * Available command arguments, and their mapping to options |
||
30 | * |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $availableArguments = [ |
||
34 | 'replicate' => 'REPLICATE', |
||
35 | 'delay' => 'DELAY', |
||
36 | 'retry' => 'RETRY', |
||
37 | 'ttl' => 'TTL', |
||
38 | 'maxlen' => 'MAXLEN', |
||
39 | 'async' => 'ASYNC' |
||
40 | ]; |
||
41 | |||
42 | /** |
||
43 | * Get command |
||
44 | * |
||
45 | * @return string Command |
||
46 | */ |
||
47 | public function getCommand() |
||
51 | |||
52 | /** |
||
53 | * Set arguments for the command |
||
54 | * |
||
55 | * The first two values in the $arguments array must be the queue name and |
||
56 | * the job body. The third value is optional and if present, must be |
||
57 | * an array with further arguments. |
||
58 | * @see $availableArguments |
||
59 | * |
||
60 | * @param array $arguments Arguments |
||
61 | * @throws InvalidCommandArgumentException |
||
62 | */ |
||
63 | public function setArguments(array $arguments) |
||
82 | } |