Completed
Pull Request — master (#30)
by Matthew
11:23
created
Tests/Doctrine/DoctrineJobManagerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -286,7 +286,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
Controller/QueueController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,13 +60,13 @@
 block discarded – undo
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";
Please login to merge, or discard this patch.
Redis/JobManager.php 1 patch
Doc Comments   +24 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,6 +26,9 @@  discard block
 block discarded – undo
26 26
     protected $hostname;
27 27
     protected $pid;
28 28
 
29
+    /**
30
+     * @param string $cacheKeyPrefix
31
+     */
29 32
     public function __construct(RunManager $runManager, JobTimingManager $jobTimingManager, $jobClass, $cacheKeyPrefix)
30 33
     {
31 34
         $this->cacheKeyPrefix = $cacheKeyPrefix;
@@ -45,6 +48,9 @@  discard block
 block discarded – undo
45 48
         return $this->cacheKeyPrefix.'_job_'.$jobId;
46 49
     }
47 50
 
51
+    /**
52
+     * @param string $jobCrc
53
+     */
48 54
     protected function getJobCrcHashKey($jobCrc)
49 55
     {
50 56
         return $this->cacheKeyPrefix.'_job_crc_'.$jobCrc;
@@ -102,6 +108,10 @@  discard block
 block discarded – undo
102 108
         return null;
103 109
     }
104 110
 
111
+    /**
112
+     * @param string $foundJobCacheKey
113
+     * @param boolean $foundJobMessage
114
+     */
105 115
     protected function batchFoundJob(\Dtc\QueueBundle\Redis\Job $job, $foundJobCacheKey, $foundJobMessage)
106 116
     {
107 117
         $when = $job->getWhenUs();
@@ -127,6 +137,10 @@  discard block
 block discarded – undo
127 137
         return $this->finishBatchFoundJob($foundJob, $foundJobCacheKey, $crcCacheKey, $newFoundWhen, $newFoundPriority);
128 138
     }
129 139
 
140
+    /**
141
+     * @param string $crcCacheKey
142
+     * @param integer|null $newFoundPriority
143
+     */
130 144
     protected function finishBatchFoundJob(Job $foundJob, $foundJobCacheKey, $crcCacheKey, $newFoundWhen, $newFoundPriority)
131 145
     {
132 146
         // Now how do we adjust this job's priority or time?
@@ -146,6 +160,9 @@  discard block
 block discarded – undo
146 160
         return $this->addFoundJob($adjust, $foundJob, $foundJobCacheKey, $crcCacheKey);
147 161
     }
148 162
 
163
+    /**
164
+     * @param boolean $adjust
165
+     */
149 166
     protected function addFoundJob($adjust, Job $foundJob, $foundJobCacheKey, $crcCacheKey)
150 167
     {
151 168
         $whenQueue = $this->getWhenQueueCacheKey();
@@ -163,6 +180,9 @@  discard block
 block discarded – undo
163 180
         return $result ?: false;
164 181
     }
165 182
 
183
+    /**
184
+     * @param string $queue
185
+     */
166 186
     private function adjustJob($adjust, $queue, Job $foundJob, $foundJobCacheKey, $crcCacheKey, $zScore)
167 187
     {
168 188
         if ($adjust && $this->redis->zRem($queue, $foundJob->getId()) > 0) {
@@ -183,7 +203,7 @@  discard block
 block discarded – undo
183 203
     /**
184 204
      * @param \Dtc\QueueBundle\Model\Job $job
185 205
      *
186
-     * @return \Dtc\QueueBundle\Model\Job
206
+     * @return null|Job
187 207
      *
188 208
      * @throws ClassNotSubclassException
189 209
      */
@@ -302,6 +322,9 @@  discard block
 block discarded – undo
302 322
         }
303 323
     }
304 324
 
325
+    /**
326
+     * @param string $workerName
327
+     */
305 328
     protected function verifyGetJobArgs($workerName = null, $methodName = null, $prioritize = true)
306 329
     {
307 330
         if (null !== $workerName || null !== $methodName || (null !== $this->maxPriority && true !== $prioritize)) {
Please login to merge, or discard this patch.
Manager/RetryableJobManager.php 1 patch
Doc Comments   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
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
      */
@@ -44,7 +44,6 @@  discard block
 block discarded – undo
44 44
     /**
45 45
      * @return bool true if retry
46 46
      *
47
-     * @param bool $retry true if the job was retried, false if not
48 47
      */
49 48
     public function saveHistory(Job $job)
50 49
     {
@@ -67,6 +66,10 @@  discard block
 block discarded – undo
67 66
         return $this->updateJobMax($job, 'Exceptions', RetryableJob::STATUS_MAX_EXCEPTIONS, $this->autoRetryOnException);
68 67
     }
69 68
 
69
+    /**
70
+     * @param string $type
71
+     * @param boolean $autoRetry
72
+     */
70 73
     protected function updateJobMax(RetryableJob $job, $type, $maxStatus, $autoRetry)
71 74
     {
72 75
         $setMethod = 'set'.$type;
@@ -121,7 +124,6 @@  discard block
 block discarded – undo
121 124
     }
122 125
 
123 126
     /**
124
-     * @param RetryableJob $retryableJob
125 127
      *
126 128
      * @return bool true if the job was successfully "reset", i.e. re-queued
127 129
      */
@@ -157,7 +159,7 @@  discard block
 block discarded – undo
157 159
     }
158 160
 
159 161
     /**
160
-     * @param int|null $defaultMaxRetry
162
+     * @param integer|null $defaultMaxRetries
161 163
      */
162 164
     public function setDefaultMaxRetries($defaultMaxRetries)
163 165
     {
@@ -173,7 +175,7 @@  discard block
 block discarded – undo
173 175
     }
174 176
 
175 177
     /**
176
-     * @param int|null $defaultMaxFailure
178
+     * @param integer|null $defaultMaxFailures
177 179
      */
178 180
     public function setDefaultMaxFailures($defaultMaxFailures)
179 181
     {
@@ -221,7 +223,7 @@  discard block
 block discarded – undo
221 223
     }
222 224
 
223 225
     /**
224
-     * @param int|null $defaultMaxException
226
+     * @param integer|null $defaultMaxExceptions
225 227
      */
226 228
     public function setDefaultMaxExceptions($defaultMaxExceptions)
227 229
     {
Please login to merge, or discard this patch.
Manager/StallableJobManager.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
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
     {
Please login to merge, or discard this patch.