Total Complexity | 6 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
9 | class Scheduler implements SchedulerInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var JobInterface[] |
||
13 | */ |
||
14 | protected $jobs; |
||
15 | |||
16 | /** |
||
17 | * Scheduler constructor |
||
18 | */ |
||
19 | public function __construct() |
||
20 | { |
||
21 | $this->jobs = []; |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @param \Jellyfish\Scheduler\JobInterface $job |
||
26 | * |
||
27 | * @return \Jellyfish\Scheduler\SchedulerInterface |
||
28 | */ |
||
29 | public function queueJob(JobInterface $job): SchedulerInterface |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * @return \Jellyfish\Scheduler\SchedulerInterface |
||
38 | */ |
||
39 | public function clearJobs(): SchedulerInterface |
||
40 | { |
||
41 | $this->jobs = []; |
||
42 | |||
43 | return $this; |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @return \Jellyfish\Scheduler\SchedulerInterface |
||
48 | * |
||
49 | * @throws \Exception |
||
50 | */ |
||
51 | public function run(): SchedulerInterface |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @return \Jellyfish\Scheduler\JobInterface[] |
||
64 | */ |
||
65 | public function getQueuedJobs(): array |
||
68 | } |
||
69 | } |
||
70 |