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 | 76 | public function save(Job $job) |
|
43 | |||
44 | /** |
||
45 | * @return bool true if retry |
||
46 | */ |
||
47 | 20 | public function saveHistory(Job $job) |
|
62 | |||
63 | 6 | private function updateJobException(RetryableJob $job) |
|
67 | |||
68 | 17 | protected function updateJobMax(RetryableJob $job, $type, $maxStatus, $autoRetry) |
|
83 | |||
84 | 9 | private function updateJobFailure(RetryableJob $job) |
|
88 | |||
89 | /** |
||
90 | * Determine if we've hit a max retry condition. |
||
91 | * |
||
92 | * @param RetryableJob $job |
||
93 | * @param int $status |
||
94 | * @param int|null $max |
||
95 | * @param int $count |
||
96 | * |
||
97 | * @return bool |
||
98 | */ |
||
99 | 19 | protected function updateMaxStatus(RetryableJob $job, $status, $max = null, $count = 0) |
|
109 | |||
110 | 14 | protected function resetRetryableJob(RetryableJob $job) |
|
120 | |||
121 | /** |
||
122 | * @param RetryableJob $job |
||
123 | * |
||
124 | * @return bool true if the job was successfully "reset", i.e. re-queued |
||
125 | */ |
||
126 | abstract protected function resetJob(RetryableJob $job); |
||
127 | |||
128 | 76 | protected function setBaseRetryableJobDefaults(RetryableJob $job) |
|
148 | |||
149 | /** |
||
150 | * @return int|null |
||
151 | */ |
||
152 | 6 | public function getDefaultMaxRetries() |
|
156 | |||
157 | /** |
||
158 | * @param int|null $defaultMaxRetries |
||
159 | */ |
||
160 | 6 | public function setDefaultMaxRetries($defaultMaxRetries) |
|
164 | |||
165 | /** |
||
166 | * @return int|null |
||
167 | */ |
||
168 | 6 | public function getDefaultMaxFailures() |
|
172 | |||
173 | /** |
||
174 | * @param int|null $defaultMaxFailure |
||
|
|||
175 | */ |
||
176 | 6 | public function setDefaultMaxFailures($defaultMaxFailures) |
|
180 | |||
181 | /** |
||
182 | * @return bool |
||
183 | */ |
||
184 | 6 | public function getAutoRetryOnFailure() |
|
188 | |||
189 | /** |
||
190 | * @param bool $autoRetryOnFailure |
||
191 | */ |
||
192 | 18 | public function setAutoRetryOnFailure($autoRetryOnFailure) |
|
196 | |||
197 | /** |
||
198 | * @return bool |
||
199 | */ |
||
200 | 6 | public function getAutoRetryOnException() |
|
204 | |||
205 | /** |
||
206 | * @param bool $autoRetryOnException |
||
207 | */ |
||
208 | 12 | public function setAutoRetryOnException($autoRetryOnException) |
|
212 | |||
213 | /** |
||
214 | * @return int|null |
||
215 | */ |
||
216 | 6 | public function getDefaultMaxExceptions() |
|
220 | |||
221 | /** |
||
222 | * @param int|null $defaultMaxException |
||
223 | */ |
||
224 | 6 | public function setDefaultMaxExceptions($defaultMaxExceptions) |
|
228 | |||
229 | 76 | protected function recordTiming(Job $job) |
|
238 | } |
||
239 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.