@@ -11,6 +11,9 @@ |
||
| 11 | 11 | protected $dm; |
| 12 | 12 | protected $documentName; |
| 13 | 13 | |
| 14 | + /** |
|
| 15 | + * @param string $documentName |
|
| 16 | + */ |
|
| 14 | 17 | public function __construct(DocumentManager $dm, $documentName) |
| 15 | 18 | { |
| 16 | 19 | $this->dm = $dm; |
@@ -33,6 +33,9 @@ |
||
| 33 | 33 | return $job; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | + /** |
|
| 37 | + * @param string $workerName |
|
| 38 | + */ |
|
| 36 | 39 | public function getJob($workerName = null, $methodName = null, $prioritize = true) |
| 37 | 40 | { |
| 38 | 41 | if ($methodName) { |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | set_time_limit($processTimeout); // Set an hour timeout |
| 69 | 69 | |
| 70 | 70 | if ($jobId = $input->getOption('job_id')) { |
| 71 | - return $this->runJobById($jobId); // Run a single job |
|
| 71 | + return $this->runJobById($jobId); // Run a single job |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | try { |
@@ -33,6 +33,9 @@ |
||
| 33 | 33 | return $job; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | + /** |
|
| 37 | + * @param string $workerName |
|
| 38 | + */ |
|
| 36 | 39 | public function getJob($workerName = null, $methodName = null, $prioritize = true) |
| 37 | 40 | { |
| 38 | 41 | if ($methodName) { |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | - * @param $message |
|
| 47 | + * @param string|null $message |
|
| 48 | 48 | */ |
| 49 | 49 | public function setMessage($message) |
| 50 | 50 | { |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
| 247 | - * @return mixed |
|
| 247 | + * @return \DateTime |
|
| 248 | 248 | */ |
| 249 | 249 | public function getStartedAt() |
| 250 | 250 | { |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | /** |
| 255 | - * @param mixed $startedAt |
|
| 255 | + * @param \DateTime $startedAt |
|
| 256 | 256 | */ |
| 257 | 257 | public function setStartedAt(\DateTime $startedAt) |
| 258 | 258 | { |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | /** |
| 271 | - * @param mixed $finishedAt |
|
| 271 | + * @param \DateTime $finishedAt |
|
| 272 | 272 | */ |
| 273 | 273 | public function setFinishedAt($finishedAt) |
| 274 | 274 | { |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | /** |
| 338 | - * @param $crcHash |
|
| 338 | + * @param string $crcHash |
|
| 339 | 339 | */ |
| 340 | 340 | public function setCrcHash($crcHash) |
| 341 | 341 | { |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | /** |
| 452 | - * @param $elapsed |
|
| 452 | + * @param double $elapsed |
|
| 453 | 453 | */ |
| 454 | 454 | public function setElapsed($elapsed) |
| 455 | 455 | { |
@@ -108,6 +108,11 @@ |
||
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | + /** |
|
| 112 | + * @param integer|null $time |
|
| 113 | + * @param string $method |
|
| 114 | + * @param integer $priority |
|
| 115 | + */ |
|
| 111 | 116 | protected function assertJob(Job $job, $time, $method, $priority = null) |
| 112 | 117 | { |
| 113 | 118 | $this->assertNotEmpty($job->getId(), 'Job should have an id'); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $this->logger->debug('No job to run'); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - return; // no job to run |
|
| 66 | + return; // no job to run |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | return $this->runJob($job); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $this->eventDispatcher->dispatch(Event::PRE_JOB, $event); |
| 76 | 76 | |
| 77 | 77 | $start = microtime(true); |
| 78 | - $handleException = function ($exception) use ($job) { |
|
| 78 | + $handleException = function($exception) use ($job) { |
|
| 79 | 79 | $exceptionMessage = get_class($exception)."\n".$exception->getCode().' - '.$exception->getMessage()."\n".$exception->getTraceAsString(); |
| 80 | 80 | if ($this->logger) { |
| 81 | 81 | $this->logger->debug("Failed: {$job->getClassName()}->{$job->getMethod()}\n$exceptionMessage"); |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | { |
| 87 | 87 | $start = microtime(true); |
| 88 | 88 | $jobsTotal = 1000; |
| 89 | - self::$jobManager->enableSorting = false; // Ignore priority |
|
| 89 | + self::$jobManager->enableSorting = false; // Ignore priority |
|
| 90 | 90 | |
| 91 | 91 | for ($i = 0; $i < $jobsTotal; ++$i) { |
| 92 | 92 | self::$worker->later()->fibonacci(1); |