1 | <?php |
||
11 | class Schedule |
||
12 | { |
||
13 | /** |
||
14 | * @var array |
||
15 | */ |
||
16 | private static $map = [ |
||
17 | '@yearly' => '0 0 1 1 *', |
||
18 | '@annually' => '0 0 1 1 *', |
||
19 | '@monthly' => '0 0 1 * *', |
||
20 | '@weekly' => '0 0 * * 0', |
||
21 | '@daily' => '0 0 * * *', |
||
22 | '@hourly' => '0 * * * *', |
||
23 | '@semi_hourly' => '*/30 * * * *', |
||
24 | '@quarter_hourly' => '*/15 * * * *', |
||
25 | '*' => '* * * * *', |
||
26 | ]; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | public $runEvery; |
||
32 | |||
33 | /** |
||
34 | * @var bool |
||
35 | */ |
||
36 | public $active = true; |
||
37 | |||
38 | /** |
||
39 | * @var null|int |
||
40 | */ |
||
41 | public $timeout = 0; |
||
42 | |||
43 | /** |
||
44 | * @var int |
||
45 | */ |
||
46 | public $version = 10; |
||
47 | |||
48 | /** |
||
49 | * @var array |
||
50 | */ |
||
51 | public $params = []; |
||
52 | |||
53 | /** |
||
54 | * @param array $options |
||
55 | * @throws \InvalidArgumentException |
||
56 | */ |
||
57 | public function __construct(array $options) |
||
69 | |||
70 | /** |
||
71 | * @throws \InvalidArgumentException |
||
72 | */ |
||
73 | public function validateTimeout() |
||
79 | |||
80 | /** |
||
81 | * @throws \InvalidArgumentException |
||
82 | */ |
||
83 | public function validateParams():void |
||
89 | |||
90 | /** |
||
91 | * @throws \InvalidArgumentException |
||
92 | */ |
||
93 | public function validateExpression() |
||
97 | |||
98 | /** |
||
99 | * @param array $options |
||
100 | * @throws \InvalidArgumentException |
||
101 | */ |
||
102 | public function populate(array $options) |
||
112 | |||
113 | /** |
||
114 | * @param array $options |
||
115 | * @return array |
||
116 | */ |
||
117 | public function mapExpression(array $options) |
||
125 | |||
126 | /** |
||
127 | * @param array $options |
||
128 | * @return array |
||
129 | */ |
||
130 | public function setDefault(array $options) |
||
139 | |||
140 | /** |
||
141 | * @param array $options |
||
142 | * @throws \InvalidArgumentException |
||
143 | * @return array |
||
144 | */ |
||
145 | public function ensureExpressionExist(array $options) |
||
152 | } |
||
153 |