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 | '@twenty_minutes' => '*/20 * * * *', |
||
25 | '@quarter_hourly' => '*/15 * * * *', |
||
26 | '@ten_minutes' => '*/10 * * * *', |
||
27 | '@five_minutes' => '*/5 * * * *', |
||
28 | '*' => '* * * * *', |
||
29 | ]; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | public $interval; |
||
35 | |||
36 | /** |
||
37 | * @var bool |
||
38 | */ |
||
39 | public $active = true; |
||
40 | |||
41 | /** |
||
42 | * @var null|int |
||
43 | */ |
||
44 | public $timeout = 0; |
||
45 | |||
46 | /** |
||
47 | * @var int |
||
48 | */ |
||
49 | public $version = 10; |
||
50 | |||
51 | /** |
||
52 | * @var array |
||
53 | */ |
||
54 | public $params = []; |
||
55 | |||
56 | /** |
||
57 | * @param array $options |
||
58 | * @throws \InvalidArgumentException |
||
59 | */ |
||
60 | public function __construct(array $options) |
||
72 | |||
73 | /** |
||
74 | * @throws \InvalidArgumentException |
||
75 | */ |
||
76 | public function validateTimeout() |
||
82 | |||
83 | /** |
||
84 | * @throws \InvalidArgumentException |
||
85 | */ |
||
86 | public function validateParams() |
||
92 | |||
93 | /** |
||
94 | * @throws \InvalidArgumentException |
||
95 | */ |
||
96 | public function validateExpression() |
||
100 | |||
101 | /** |
||
102 | * @param array $options |
||
103 | * @throws \InvalidArgumentException |
||
104 | */ |
||
105 | public function populate(array $options) |
||
115 | |||
116 | /** |
||
117 | * @param array $options |
||
118 | * @return array |
||
119 | */ |
||
120 | public function mapExpression(array $options) |
||
128 | |||
129 | /** |
||
130 | * @param array $options |
||
131 | * @return array |
||
132 | */ |
||
133 | public function setDefault(array $options) |
||
142 | |||
143 | /** |
||
144 | * @param array $options |
||
145 | * @throws \InvalidArgumentException |
||
146 | * @return array |
||
147 | */ |
||
148 | public function ensureExpressionExist(array $options) |
||
155 | } |
||
156 |