Completed
Push — master ( c2e487...7ac6a5 )
by Wachter
07:39
created

RunCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 2
dl 0
loc 30
ccs 10
cts 10
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A configure() 0 4 1
A execute() 0 4 1
1
<?php
2
3
namespace Task\TaskBundle\Command;
4
5
use Symfony\Component\Console\Command\Command;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
use Task\SchedulerInterface;
9
10
/**
11
 * Run pending tasks.
12
 *
13
 * @author @wachterjohannes <[email protected]>
14
 */
15
class RunCommand extends Command
16
{
17
    /**
18
     * @var SchedulerInterface
19
     */
20
    private $scheduler;
21
22 2
    public function __construct(SchedulerInterface $scheduler)
23
    {
24 2
        parent::__construct('task:run');
25
26 2
        $this->scheduler = $scheduler;
27 2
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32 2
    protected function configure()
33
    {
34 2
        $this->setDescription('Run pending tasks');
35 2
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40 1
    protected function execute(InputInterface $input, OutputInterface $output)
41
    {
42 1
        $this->scheduler->run();
43 1
    }
44
}
45