1 | <?php |
||
10 | abstract class RetryableJobManager extends AbstractJobManager |
||
11 | { |
||
12 | protected $defaultMaxRetries; |
||
13 | protected $defaultMaxFailures; |
||
14 | protected $defaultMaxExceptions; |
||
15 | |||
16 | protected $autoRetryOnFailure; |
||
17 | protected $autoRetryOnException; |
||
18 | |||
19 | abstract protected function retryableSave(RetryableJob $job); |
||
20 | |||
21 | /** |
||
22 | * @param RetryableJob $job |
||
23 | * @param $retry bool |
||
24 | * |
||
25 | * @return |
||
26 | */ |
||
27 | abstract protected function retryableSaveHistory(RetryableJob $job, $retry); |
||
28 | |||
29 | public function save(Job $job) |
||
43 | |||
44 | /** |
||
45 | * @return bool true if retry |
||
46 | * |
||
47 | * @param bool $retry true if the job was retried, false if not |
||
|
|||
48 | */ |
||
49 | public function saveHistory(Job $job) |
||
64 | |||
65 | private function updateJobException(RetryableJob $job) |
||
69 | |||
70 | protected function updateJobMax(RetryableJob $job, $type, $maxStatus, $autoRetry) |
||
85 | |||
86 | private function updateJobFailure(RetryableJob $job) |
||
90 | |||
91 | /** |
||
92 | * Determine if we've hit a max retry condition. |
||
93 | * |
||
94 | * @param RetryableJob $job |
||
95 | * @param $status |
||
96 | * @param null $max |
||
97 | * @param int $count |
||
98 | * |
||
99 | * @return bool |
||
100 | */ |
||
101 | protected function updateMaxStatus(RetryableJob $job, $status, $max = null, $count = 0) |
||
111 | |||
112 | protected function resetRetryableJob(RetryableJob $job) |
||
122 | |||
123 | /** |
||
124 | * @param RetryableJob $retryableJob |
||
125 | * |
||
126 | * @return bool true if the job was successfully "reset", i.e. re-queued |
||
127 | */ |
||
128 | abstract protected function resetJob(RetryableJob $job); |
||
129 | |||
130 | protected function setBaseRetryableJobDefaults(RetryableJob $job) |
||
150 | |||
151 | /** |
||
152 | * @return int|null |
||
153 | */ |
||
154 | public function getDefaultMaxRetries() |
||
158 | |||
159 | /** |
||
160 | * @param int|null $defaultMaxRetry |
||
161 | */ |
||
162 | public function setDefaultMaxRetries($defaultMaxRetries) |
||
166 | |||
167 | /** |
||
168 | * @return int|null |
||
169 | */ |
||
170 | public function getDefaultMaxFailures() |
||
174 | |||
175 | /** |
||
176 | * @param int|null $defaultMaxFailure |
||
177 | */ |
||
178 | public function setDefaultMaxFailures($defaultMaxFailures) |
||
182 | |||
183 | /** |
||
184 | * @return bool |
||
185 | */ |
||
186 | public function getAutoRetryOnFailure() |
||
190 | |||
191 | /** |
||
192 | * @param bool $autoRetryOnFailure |
||
193 | */ |
||
194 | public function setAutoRetryOnFailure($autoRetryOnFailure) |
||
198 | |||
199 | /** |
||
200 | * @return bool |
||
201 | */ |
||
202 | public function getAutoRetryOnException() |
||
206 | |||
207 | /** |
||
208 | * @param bool $autoRetryOnException |
||
209 | */ |
||
210 | public function setAutoRetryOnException($autoRetryOnException) |
||
214 | |||
215 | /** |
||
216 | * @return int|null |
||
217 | */ |
||
218 | public function getDefaultMaxExceptions() |
||
222 | |||
223 | /** |
||
224 | * @param int|null $defaultMaxException |
||
225 | */ |
||
226 | public function setDefaultMaxExceptions($defaultMaxExceptions) |
||
230 | |||
231 | protected function recordTiming(Job $job) |
||
240 | } |
||
241 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.