@@ -207,6 +207,9 @@  | 
                                                    ||
| 207 | 207 | return $count;  | 
                                                        
| 208 | 208 | }  | 
                                                        
| 209 | 209 | |
| 210 | + /**  | 
                                                        |
| 211 | + * @param integer $expected  | 
                                                        |
| 212 | + */  | 
                                                        |
| 210 | 213 | protected static function getWaitingJobCount($expected)  | 
                                                        
| 211 | 214 |      { | 
                                                        
| 212 | 215 | $count = self::$jobManager->getWaitingJobCount();  | 
                                                        
@@ -252,6 +252,9 @@  | 
                                                    ||
| 252 | 252 | self::$jobManager->saveHistory($jobInQueue);  | 
                                                        
| 253 | 253 | }  | 
                                                        
| 254 | 254 | |
| 255 | + /**  | 
                                                        |
| 256 | + * @param \PhpAmqpLib\Channel\AMQPChannel $channel  | 
                                                        |
| 257 | + */  | 
                                                        |
| 255 | 258 | protected static function drainQueue($channel)  | 
                                                        
| 256 | 259 |      { | 
                                                        
| 257 | 260 | $drained = 0;  | 
                                                        
@@ -26,7 +26,7 @@  | 
                                                    ||
| 26 | 26 | $firstJob = key($status);  | 
                                                        
| 27 | 27 |          if ($firstJob) { | 
                                                        
| 28 | 28 | $jobKeys = array_keys($status);  | 
                                                        
| 29 | -            $maxLength = max(array_map(function ($item) { | 
                                                        |
| 29 | +            $maxLength = max(array_map(function($item) { | 
                                                        |
| 30 | 30 | return strlen($item ?: '');  | 
                                                        
| 31 | 31 | }, $jobKeys));  | 
                                                        
| 32 | 32 | $formatLen = $maxLength > 50 ? 50 : $maxLength;  | 
                                                        
@@ -128,7 +128,7 @@ discard block  | 
                                                    ||
| 128 | 128 |          $workerName = $request->get('workerName'); | 
                                                        
| 129 | 129 |          $methodName = $request->get('method'); | 
                                                        
| 130 | 130 | $total = null;  | 
                                                        
| 131 | -        $callback = function ($count, $totalCount) use (&$total) { | 
                                                        |
| 131 | +        $callback = function($count, $totalCount) use (&$total) { | 
                                                        |
| 132 | 132 |              if (null !== $totalCount && null === $total) { | 
                                                        
| 133 | 133 | $total = $totalCount;  | 
                                                        
| 134 | 134 | echo json_encode(['total' => $total]);  | 
                                                        
@@ -142,7 +142,7 @@ discard block  | 
                                                    ||
| 142 | 142 | flush();  | 
                                                        
| 143 | 143 | };  | 
                                                        
| 144 | 144 | |
| 145 | -        return function () use ($jobManager, $callback, $workerName, $methodName, $functionName, &$total) { | 
                                                        |
| 145 | +        return function() use ($jobManager, $callback, $workerName, $methodName, $functionName, &$total) { | 
                                                        |
| 146 | 146 |              switch ($functionName) { | 
                                                        
| 147 | 147 | case 'archiveAllJobs':  | 
                                                        
| 148 | 148 | $total = $jobManager->countLiveJobs($workerName, $methodName);  |