1 | <?php |
||
13 | class RepeatableTask implements TaskInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var int |
||
17 | */ |
||
18 | protected $repeatInterval = 0; |
||
|
|||
19 | |||
20 | /** |
||
21 | * @var int |
||
22 | */ |
||
23 | protected $expiryTime = 0; |
||
24 | |||
25 | /** |
||
26 | * @var TaskInterface |
||
27 | */ |
||
28 | protected $childTask; |
||
29 | |||
30 | /** |
||
31 | * RepeatableTask constructor. |
||
32 | * |
||
33 | * @param TaskInterface $childTask |
||
34 | * @param int $repeatInterval |
||
35 | */ |
||
36 | 6 | public function __construct(TaskInterface $childTask, int $repeatInterval) |
|
42 | |||
43 | /** |
||
44 | * @return null|TaskInterface |
||
45 | */ |
||
46 | 4 | public function run(): ?TaskInterface |
|
59 | |||
60 | 2 | public function cancel(): void |
|
66 | |||
67 | /** |
||
68 | * @return int |
||
69 | */ |
||
70 | 6 | public function getRepeatInterval(): int |
|
74 | |||
75 | /** |
||
76 | * @param int $repeatInterval |
||
77 | */ |
||
78 | 1 | public function setRepeatInterval(int $repeatInterval) |
|
82 | |||
83 | /** |
||
84 | * @return int |
||
85 | */ |
||
86 | 5 | public function getExpiryTime(): int |
|
90 | } |