WorkerApplication   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 19
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 2
1
<?php
2
3
namespace JobQueue\Application\Console;
4
5
use JobQueue\Domain\Task\Queue;
6
use Psr\Log\LoggerInterface;
7
use Symfony\Component\Console\Application;
8
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
9
10
final class WorkerApplication extends Application
11
{
12
    /**
13
     *
14
     * @param Queue                    $queue
15
     * @param EventDispatcherInterface $eventDispatcher
16
     * @param LoggerInterface|null     $logger
17
     */
18
    public function __construct(Queue $queue, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger = null)
19
    {
20
        parent::__construct('worker', 1.0);
21
22
        $consumeCommand = new Consume($queue, $eventDispatcher);
23
        if ($logger) {
24
            $consumeCommand->setLogger($logger);
25
        }
26
27
        $this->add($consumeCommand);
28
        $this->setDefaultCommand('consume', true);
29
    }
30
}
31