@@ -80,7 +80,7 @@ |
||
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $format = $this->getDateFormat($type); |
| 83 | - usort($timingsDates, function ($date1str, $date2str) use ($format) { |
|
| 83 | + usort($timingsDates, function($date1str, $date2str) use ($format) { |
|
| 84 | 84 | $date1 = \DateTime::createFromFormat($format, $date1str); |
| 85 | 85 | $date2 = \DateTime::createFromFormat($format, $date2str); |
| 86 | 86 | if (!$date2) { |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | $total += count($this->jobs[$jobWorkerName]); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - return array_sum(array_map(function ($jobs) { |
|
| 39 | + return array_sum(array_map(function($jobs) { |
|
| 40 | 40 | return count($jobs); |
| 41 | 41 | }, $this->jobs)); |
| 42 | 42 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | - * @return mixed |
|
| 30 | + * @return integer |
|
| 31 | 31 | */ |
| 32 | 32 | public function getMaxFailures() |
| 33 | 33 | { |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | - * @param mixed $maxFailure |
|
| 38 | + * @param mixed $maxFailures |
|
| 39 | 39 | */ |
| 40 | 40 | public function setMaxFailures($maxFailures) |
| 41 | 41 | { |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
| 124 | - * @return mixed |
|
| 124 | + * @return integer |
|
| 125 | 125 | */ |
| 126 | 126 | public function getMaxExceptions() |
| 127 | 127 | { |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
| 132 | - * @param mixed $maxException |
|
| 132 | + * @param mixed $maxExceptions |
|
| 133 | 133 | */ |
| 134 | 134 | public function setMaxExceptions($maxExceptions) |
| 135 | 135 | { |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | ]; |
| 71 | 71 | |
| 72 | 72 | try { |
| 73 | - $this->predis->transaction($options, function ($tx) use ($key, &$element) { |
|
| 73 | + $this->predis->transaction($options, function($tx) use ($key, &$element) { |
|
| 74 | 74 | @list($element) = $tx->zrange($key, 0, 0); |
| 75 | 75 | |
| 76 | 76 | if (isset($element)) { |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | ]; |
| 96 | 96 | |
| 97 | 97 | try { |
| 98 | - $this->predis->transaction($options, function ($tx) use ($key, $max, &$element) { |
|
| 98 | + $this->predis->transaction($options, function($tx) use ($key, $max, &$element) { |
|
| 99 | 99 | @list($element) = $tx->zrangebyscore($key, 0, $max, ['LIMIT' => [0, 1]]); |
| 100 | 100 | |
| 101 | 101 | if (isset($element)) { |
@@ -286,7 +286,7 @@ |
||
| 286 | 286 | self::assertEquals(1, $count); |
| 287 | 287 | $allCount = $this->runCountQuery($jobManager->getJobClass()); |
| 288 | 288 | $counter = 0; |
| 289 | - $countJobs = function ($count) use (&$counter) { |
|
| 289 | + $countJobs = function($count) use (&$counter) { |
|
| 290 | 290 | $counter += $count; |
| 291 | 291 | }; |
| 292 | 292 | $jobManager->archiveAllJobs(null, null, $countJobs); |
@@ -60,13 +60,13 @@ |
||
| 60 | 60 | $methodName = $request->get('method'); |
| 61 | 61 | |
| 62 | 62 | $jobManager = $this->get('dtc_queue.manager.job'); |
| 63 | - $callback = function ($count) { |
|
| 63 | + $callback = function($count) { |
|
| 64 | 64 | echo json_encode(['count' => $count]); |
| 65 | 65 | echo "\n"; |
| 66 | 66 | flush(); |
| 67 | 67 | }; |
| 68 | 68 | |
| 69 | - $streamingResponse = new StreamedResponse(function () use ($jobManager, $callback, $workerName, $methodName) { |
|
| 69 | + $streamingResponse = new StreamedResponse(function() use ($jobManager, $callback, $workerName, $methodName) { |
|
| 70 | 70 | $total = $jobManager->countLiveJobs($workerName, $methodName); |
| 71 | 71 | echo json_encode(['total' => $total]); |
| 72 | 72 | echo "\n"; |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | - * @param int|null $defaultMaxStalled |
|
| 86 | + * @param integer|null $defaultMaxStalls |
|
| 87 | 87 | */ |
| 88 | 88 | public function setDefaultMaxStalls($defaultMaxStalls) |
| 89 | 89 | { |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | ->scalarNode('alias') |
| 269 | 269 | ->defaultNull()->end() |
| 270 | 270 | ->end() |
| 271 | - ->validate()->ifTrue(function ($node) { |
|
| 271 | + ->validate()->ifTrue(function($node) { |
|
| 272 | 272 | if (isset($node['type']) && !isset($node['alias'])) { |
| 273 | 273 | return true; |
| 274 | 274 | } |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | ->scalarNode('dsn')->defaultNull()->end() |
| 292 | 292 | ->append($this->addPredisArgs()) |
| 293 | 293 | ->end() |
| 294 | - ->validate()->ifTrue(function ($node) { |
|
| 294 | + ->validate()->ifTrue(function($node) { |
|
| 295 | 295 | if (isset($node['dsn']) && (isset($node['connection_parameters']['host']) || isset($node['connection_parameters']['port']))) { |
| 296 | 296 | return true; |
| 297 | 297 | } |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | ->append($this->addPredis()) |
| 315 | 315 | ->append($this->addPhpRedisArgs()) |
| 316 | 316 | ->end() |
| 317 | - ->validate()->ifTrue(function ($node) { |
|
| 317 | + ->validate()->ifTrue(function($node) { |
|
| 318 | 318 | if ((isset($node['predis']['dsn']) || isset($node['predis']['connection_parameters']['host'])) && |
| 319 | 319 | (isset($node['snc_redis']['type']) || isset($node['phpredis']['host']))) { |
| 320 | 320 | return true; |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | ->floatNode('read_timeout')->defaultValue(0)->end() |
| 351 | 351 | ->scalarNode('auth')->end() |
| 352 | 352 | ->end() |
| 353 | - ->validate()->ifTrue(function ($node) { |
|
| 353 | + ->validate()->ifTrue(function($node) { |
|
| 354 | 354 | if (!empty($node) && !isset($node['host'])) { |
| 355 | 355 | return true; |
| 356 | 356 | } |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | ->booleanNode('iterable_multibulk')->defaultFalse()->end() |
| 384 | 384 | ->booleanNode('throw_errors')->defaultTrue()->end() |
| 385 | 385 | ->end() |
| 386 | - ->validate()->ifTrue(function ($node) { |
|
| 386 | + ->validate()->ifTrue(function($node) { |
|
| 387 | 387 | if (isset($node['host']) && !isset($node['port'])) { |
| 388 | 388 | return true; |
| 389 | 389 | } |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | $rootNode |
| 424 | 424 | ->prototype('variable')->end() |
| 425 | 425 | ->validate() |
| 426 | - ->ifTrue(function ($node) { |
|
| 426 | + ->ifTrue(function($node) { |
|
| 427 | 427 | if (!is_array($node)) { |
| 428 | 428 | return true; |
| 429 | 429 | } |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | ->append($this->addRabbitMqArgs()) |
| 501 | 501 | ->append($this->addRabbitMqExchange()) |
| 502 | 502 | ->end() |
| 503 | - ->validate()->always(function ($node) { |
|
| 503 | + ->validate()->always(function($node) { |
|
| 504 | 504 | if (empty($node['ssl_options'])) { |
| 505 | 505 | unset($node['ssl_options']); |
| 506 | 506 | } |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | |
| 511 | 511 | return $node; |
| 512 | 512 | })->end() |
| 513 | - ->validate()->ifTrue(function ($node) { |
|
| 513 | + ->validate()->ifTrue(function($node) { |
|
| 514 | 514 | if (isset($node['ssl_options']) && !$node['ssl']) { |
| 515 | 515 | return true; |
| 516 | 516 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * @param RetryableJob $job |
| 23 | - * @param $retry bool |
|
| 23 | + * @param boolean $retry bool |
|
| 24 | 24 | * |
| 25 | 25 | * @return |
| 26 | 26 | */ |
@@ -65,6 +65,10 @@ discard block |
||
| 65 | 65 | return $this->updateJobMax($job, 'Exceptions', RetryableJob::STATUS_MAX_EXCEPTIONS, $this->autoRetryOnException); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | + /** |
|
| 69 | + * @param string $type |
|
| 70 | + * @param boolean $autoRetry |
|
| 71 | + */ |
|
| 68 | 72 | protected function updateJobMax(RetryableJob $job, $type, $maxStatus, $autoRetry) |
| 69 | 73 | { |
| 70 | 74 | $setMethod = 'set'.$type; |
@@ -171,7 +175,7 @@ discard block |
||
| 171 | 175 | } |
| 172 | 176 | |
| 173 | 177 | /** |
| 174 | - * @param int|null $defaultMaxFailure |
|
| 178 | + * @param integer|null $defaultMaxFailures |
|
| 175 | 179 | */ |
| 176 | 180 | public function setDefaultMaxFailures($defaultMaxFailures) |
| 177 | 181 | { |
@@ -219,7 +223,7 @@ discard block |
||
| 219 | 223 | } |
| 220 | 224 | |
| 221 | 225 | /** |
| 222 | - * @param int|null $defaultMaxException |
|
| 226 | + * @param integer|null $defaultMaxExceptions |
|
| 223 | 227 | */ |
| 224 | 228 | public function setDefaultMaxExceptions($defaultMaxExceptions) |
| 225 | 229 | { |