@@ -33,7 +33,7 @@ |
||
33 | 33 | $total += count($this->jobs[$jobWorkerName]); |
34 | 34 | } |
35 | 35 | |
36 | - return array_sum(array_map(function ($jobs) { return count($jobs); }, $this->jobs)); |
|
36 | + return array_sum(array_map(function($jobs) { return count($jobs); }, $this->jobs)); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | public function getStatus() |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $rootNode |
90 | 90 | ->prototype('variable')->end() |
91 | 91 | ->validate() |
92 | - ->ifTrue(function ($node) { |
|
92 | + ->ifTrue(function($node) { |
|
93 | 93 | if (!is_array($node)) { |
94 | 94 | return true; |
95 | 95 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | ->append($this->addRabbitMqSslOptions()) |
167 | 167 | ->append($this->addRabbitMqArgs()) |
168 | 168 | ->append($this->addRabbitMqExchange()) |
169 | - ->validate()->always(function ($node) { |
|
169 | + ->validate()->always(function($node) { |
|
170 | 170 | if (empty($node['ssl_options'])) { |
171 | 171 | unset($node['ssl_options']); |
172 | 172 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | |
177 | 177 | return $node; |
178 | 178 | })->end() |
179 | - ->validate()->ifTrue(function ($node) { |
|
179 | + ->validate()->ifTrue(function($node) { |
|
180 | 180 | if (isset($node['ssl_options']) && !$node['ssl']) { |
181 | 181 | return true; |
182 | 182 | } |
@@ -239,6 +239,7 @@ discard block |
||
239 | 239 | * @param string $workerName |
240 | 240 | * @param string $methodName |
241 | 241 | * @param bool $prioritize |
242 | + * @param integer $runId |
|
242 | 243 | * |
243 | 244 | * @return Job|null |
244 | 245 | */ |
@@ -255,8 +256,8 @@ discard block |
||
255 | 256 | } |
256 | 257 | |
257 | 258 | /** |
258 | - * @param null $workerName |
|
259 | - * @param null $methodName |
|
259 | + * @param string|null $workerName |
|
260 | + * @param string|null $methodName |
|
260 | 261 | * @param bool $prioritize |
261 | 262 | * |
262 | 263 | * @return QueryBuilder |
@@ -332,7 +333,7 @@ discard block |
||
332 | 333 | * |
333 | 334 | * @param \Dtc\QueueBundle\Model\Job $job |
334 | 335 | * |
335 | - * @return mixed|null |
|
336 | + * @return null|Job |
|
336 | 337 | */ |
337 | 338 | public function updateNearestBatch(\Dtc\QueueBundle\Model\Job $job) |
338 | 339 | { |
@@ -361,6 +362,10 @@ discard block |
||
361 | 362 | return $existingJob; |
362 | 363 | } |
363 | 364 | |
365 | + /** |
|
366 | + * @param integer $newPriority |
|
367 | + * @param null|\DateTime $newWhenAt |
|
368 | + */ |
|
364 | 369 | protected function updateBatchJob(Job $existingJob, $newPriority, $newWhenAt) |
365 | 370 | { |
366 | 371 | $existingPriority = $existingJob->getPriority(); |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $queryBuilder = $this->jobManager->getJobQueryBuilder(); |
38 | 38 | $queryBuilder->add('select', 'j'); |
39 | 39 | $queryBuilder->setFirstResult($this->offset) |
40 | - ->setMaxResults($this->limit); |
|
40 | + ->setMaxResults($this->limit); |
|
41 | 41 | |
42 | 42 | return $queryBuilder; |
43 | 43 | } |
@@ -244,7 +244,7 @@ |
||
244 | 244 | $timingsDates = array_unique(array_merge(array_keys($timingsData), $timingsDates)); |
245 | 245 | } |
246 | 246 | |
247 | - usort($timingsDates, function ($date1str, $date2str) { |
|
247 | + usort($timingsDates, function($date1str, $date2str) { |
|
248 | 248 | $date1 = \DateTime::createFromFormat('Y-m-d H', $date1str); |
249 | 249 | $date2 = \DateTime::createFromFormat('Y-m-d H', $date2str); |
250 | 250 | if (!$date2) { |
@@ -74,6 +74,9 @@ discard block |
||
74 | 74 | return $params; |
75 | 75 | } |
76 | 76 | |
77 | + /** |
|
78 | + * @param string $type |
|
79 | + */ |
|
77 | 80 | protected function validateManagerType($type) |
78 | 81 | { |
79 | 82 | $managerType = $this->container->getParameter($type); |
@@ -201,7 +204,6 @@ discard block |
||
201 | 204 | /** |
202 | 205 | * @Route("/timings", name="dtc_queue_timings") |
203 | 206 | * |
204 | - * @param Request $request |
|
205 | 207 | */ |
206 | 208 | public function getTimingsAction() |
207 | 209 | { |
@@ -221,6 +223,10 @@ discard block |
||
221 | 223 | return new JsonResponse($params); |
222 | 224 | } |
223 | 225 | |
226 | + /** |
|
227 | + * @param \DateTime|null $beginDate |
|
228 | + * @param \DateTime $endDate |
|
229 | + */ |
|
224 | 230 | protected function calculateTimings($type, $beginDate, $endDate) |
225 | 231 | { |
226 | 232 | $params = []; |
@@ -48,6 +48,9 @@ discard block |
||
48 | 48 | $this->setupDoctrineManagers($container); |
49 | 49 | } |
50 | 50 | |
51 | + /** |
|
52 | + * @param string $type |
|
53 | + */ |
|
51 | 54 | protected function setupAlias(ContainerBuilder $container, $defaultManagerType, $type) |
52 | 55 | { |
53 | 56 | $definitionName = 'dtc_queue.'.$type.'.'.$defaultManagerType; |
@@ -78,7 +81,6 @@ discard block |
||
78 | 81 | |
79 | 82 | /** |
80 | 83 | * @param ContainerBuilder $container |
81 | - * @param Reference[] $jobManagerRef |
|
82 | 84 | * @param string $jobClass |
83 | 85 | */ |
84 | 86 | protected function setupTaggedServices(ContainerBuilder $container, Definition $definition, $jobClass) |
@@ -189,6 +191,11 @@ discard block |
||
189 | 191 | return $managerType; |
190 | 192 | } |
191 | 193 | |
194 | + /** |
|
195 | + * @param string $managerType |
|
196 | + * @param string $type |
|
197 | + * @param string $className |
|
198 | + */ |
|
192 | 199 | protected function getClass(ContainerBuilder $container, $managerType, $type, $className, $baseClass) |
193 | 200 | { |
194 | 201 | $runClass = $container->hasParameter('dtc_queue.class_'.$type) ? $container->getParameter('dtc_queue.class_'.$type) : null; |
@@ -34,10 +34,7 @@ discard block |
||
34 | 34 | protected $jobArchiveClass; |
35 | 35 | |
36 | 36 | /** |
37 | - * @param string $objectName |
|
38 | - * @param string $archiveObjectName |
|
39 | - * @param string $runClass |
|
40 | - * @param string $runArchiveClass |
|
37 | + * @param string $jobArchiveClass |
|
41 | 38 | */ |
42 | 39 | public function __construct(RunManager $runManager, JobTimingManager $jobTimingManager, ObjectManager $objectManager, |
43 | 40 | $jobClass, |
@@ -113,6 +110,10 @@ discard block |
||
113 | 110 | } |
114 | 111 | } |
115 | 112 | |
113 | + /** |
|
114 | + * @param string $workerName |
|
115 | + * @param string $method |
|
116 | + */ |
|
116 | 117 | public function pruneExpiredJobs($workerName = null, $method = null) |
117 | 118 | { |
118 | 119 | $count = $this->updateExpired($workerName, $method); |
@@ -248,6 +249,10 @@ discard block |
||
248 | 249 | return false; |
249 | 250 | } |
250 | 251 | |
252 | + /** |
|
253 | + * @param integer $i |
|
254 | + * @param integer $count |
|
255 | + */ |
|
251 | 256 | protected function runStalledLoop($i, $count, array $stalledJobs, &$countProcessed) |
252 | 257 | { |
253 | 258 | $objectManager = $this->getObjectManager(); |
@@ -361,6 +366,9 @@ discard block |
||
361 | 366 | */ |
362 | 367 | abstract protected function stopIdGenerator($objectName); |
363 | 368 | |
369 | + /** |
|
370 | + * @param string $objectName |
|
371 | + */ |
|
364 | 372 | abstract protected function restoreIdGenerator($objectName); |
365 | 373 | |
366 | 374 | /** |
@@ -397,6 +405,9 @@ discard block |
||
397 | 405 | return $countProcessed; |
398 | 406 | } |
399 | 407 | |
408 | + /** |
|
409 | + * @param string $function |
|
410 | + */ |
|
400 | 411 | protected function resetSaveOk($function) |
401 | 412 | { |
402 | 413 | } |
@@ -410,7 +421,7 @@ discard block |
||
410 | 421 | |
411 | 422 | /** |
412 | 423 | * @param RetryableJob $jobArchive |
413 | - * @param $className |
|
424 | + * @param string $className |
|
414 | 425 | * @param $countProcessed |
415 | 426 | */ |
416 | 427 | protected function resetJob(RetryableJob $jobArchive, $className, &$countProcessed) |
@@ -241,8 +241,8 @@ |
||
241 | 241 | } |
242 | 242 | |
243 | 243 | /** |
244 | - * @param null $workerName |
|
245 | - * @param null $methodName |
|
244 | + * @param string|null $workerName |
|
245 | + * @param string|null $methodName |
|
246 | 246 | * @param bool $prioritize |
247 | 247 | * |
248 | 248 | * @return Builder |