QueueRunner::runQueue()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 1
1
<?php
2
3
namespace Symbiote\QueuedJobs\Tasks\Engines;
4
5
use Symbiote\QueuedJobs\DataObjects\QueuedJobDescriptor;
6
7
/**
8
 * Runs all jobs in a queue loop in one process
9
 */
10
class QueueRunner extends BaseRunner implements TaskRunnerEngine
11
{
12
    /**
13
     * @param string $queue
14
     */
15
    public function runQueue($queue)
16
    {
17
        $service = $this->getService();
18
19
        $nextJob = $service->getNextPendingJob($queue);
20
        $this->logDescriptorStatus($nextJob, $queue);
21
22
        if ($nextJob instanceof QueuedJobDescriptor) {
23
            $service->processJobQueue($queue);
24
        }
25
    }
26
}
27