| 1 | <?php |
||
| 18 | class TestJobContract extends JobContract |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var ContainerInterface |
||
| 22 | */ |
||
| 23 | private $_container; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Get the job identifier. |
||
| 27 | * |
||
| 28 | * @return string |
||
| 29 | */ |
||
| 30 | public function getJobId(): string |
||
| 34 | |||
| 35 | /** |
||
| 36 | * TestJob constructor. |
||
| 37 | * |
||
| 38 | * @param ContainerInterface $container |
||
| 39 | */ |
||
| 40 | public function __construct(ContainerInterface $container) |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Get container instance |
||
| 47 | * |
||
| 48 | * @return ContainerInterface |
||
| 49 | */ |
||
| 50 | public function getContainer() |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Delete job |
||
| 57 | * |
||
| 58 | * @throws SuccessJobException |
||
| 59 | */ |
||
| 60 | public function delete() |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Get the raw body of the job. |
||
| 67 | * |
||
| 68 | * @return string |
||
| 69 | */ |
||
| 70 | public function getRawBody(): string |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Resolve the given class |
||
| 77 | * |
||
| 78 | * @param string $class |
||
| 79 | * |
||
| 80 | * @return JobInterface |
||
| 81 | */ |
||
| 82 | protected function resolve(string $class): JobInterface |
||
| 86 | |||
| 87 | /** |
||
| 88 | * Get is job reserved |
||
| 89 | * |
||
| 90 | * @return bool |
||
| 91 | */ |
||
| 92 | public function reserved(): bool |
||
| 96 | |||
| 97 | /** |
||
| 98 | * Get the number of times the job has been attempted. |
||
| 99 | * |
||
| 100 | * @return int |
||
| 101 | */ |
||
| 102 | public function attempts(): int |
||
| 106 | } |
||
| 107 |