| Total Complexity | 6 |
| Total Lines | 64 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class SchedulerFacade implements SchedulerFacadeInterface |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var \Jellyfish\Scheduler\SchedulerFactory |
||
| 9 | */ |
||
| 10 | protected $factory; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @param \Jellyfish\Scheduler\SchedulerFactory $factory |
||
| 14 | */ |
||
| 15 | public function __construct(SchedulerFactory $factory) |
||
| 16 | { |
||
| 17 | $this->factory = $factory; |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param string[] $command |
||
| 22 | * @param string $cronExpression |
||
| 23 | * |
||
| 24 | * @return \Jellyfish\Scheduler\JobInterface |
||
| 25 | */ |
||
| 26 | public function createJob(array $command, string $cronExpression): JobInterface |
||
| 27 | { |
||
| 28 | return $this->factory->createJob($command, $cronExpression); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param \Jellyfish\Scheduler\JobInterface $job |
||
| 33 | * |
||
| 34 | * @return SchedulerFacadeInterface |
||
| 35 | */ |
||
| 36 | public function queueJob(JobInterface $job): SchedulerFacadeInterface |
||
| 37 | { |
||
| 38 | $this->factory->getScheduler()->queueJob($job); |
||
| 39 | |||
| 40 | return $this; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return \Jellyfish\Scheduler\SchedulerFacadeInterface |
||
| 45 | */ |
||
| 46 | public function runScheduler(): SchedulerFacadeInterface |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return \Jellyfish\Scheduler\JobInterface[] |
||
| 55 | */ |
||
| 56 | public function getQueuedJobs(): array |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return \Jellyfish\Scheduler\SchedulerFacadeInterface |
||
| 63 | */ |
||
| 64 | public function clearJobs(): SchedulerFacadeInterface |
||
| 69 | } |
||
| 70 | } |
||
| 71 |