Completed
Push — master ( b3f90f...c5536c )
by Daniel
03:02
created

RunCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 53.85%

Importance

Changes 5
Bugs 0 Features 2
Metric Value
wmc 2
c 5
b 0
f 2
lcom 0
cbo 5
dl 0
loc 28
ccs 7
cts 13
cp 0.5385
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 8 1
A execute() 0 10 1
1
<?php
2
/**
3
 * This file is part of the Commander project.
4
 *
5
 * @author Daniel Schröder <[email protected]>
6
 */
7
8
namespace GravityMedia\Commander\Console\Command;
9
10
use GravityMedia\Commander\Commander\TaskRunner;
11
use Symfony\Component\Console\Input\InputInterface;
12
use Symfony\Component\Console\Output\OutputInterface;
13
14
/**
15
 * Run command class.
16
 *
17
 * @package GravityMedia\Commander\Console\Command
18
 */
19
class RunCommand extends Command
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    protected function configure()
25
    {
26
        parent::configure();
27
28
        $this
29
            ->setName('run')
30
            ->setDescription('Run all joined tasks');
31
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 2
    protected function execute(InputInterface $input, OutputInterface $output)
37
    {
38 2
        $commander = $this->getCommander()->initialize();
39
40 2
        $taskManager = $commander->getTaskManager();
41 2
        $logger = $commander->getLogger();
42
43 2
        $taskRunner = new TaskRunner($taskManager, $output, $logger);
44 2
        $taskRunner->runAll($this->getConfiguration()->getProcessTimeout());
45 2
    }
46
}
47