ManagerApplication::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.4285
c 0
b 0
f 0
ccs 0
cts 13
cp 0
cc 1
eloc 12
nc 1
nop 1
crap 2
1
<?php
2
3
namespace JobQueue\Application\Console;
4
5
use JobQueue\Domain\Task\Queue;
6
use Symfony\Component\Console\Application;
7
use Symfony\Component\Console\Command\ListCommand;
8
9
final class ManagerApplication extends Application
10
{
11
    /**
12
     *
13
     * @param Queue $queue
14
     */
15
    public function __construct(Queue $queue)
16
    {
17
        parent::__construct('manager', 1.0);
18
19
        $manCommand = new ListCommand;
20
        $manCommand->setName('man');
21
22
        $this->add($manCommand);
23
        $this->add(new ListTasks($queue));
24
        $this->add(new AddTask($queue));
25
        $this->add(new ShowTask($queue));
26
        $this->add(new EditTask($queue));
27
        $this->add(new DeleteTask($queue));
28
        $this->add(new RestoreTasks($queue));
29
        $this->add(new FlushTasks($queue));
30
        $this->setDefaultCommand('man');
31
    }
32
}
33