Completed
Pull Request — master (#531)
by
unknown
03:07
created

ProcessExecutor   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
lcom 1
cbo 5
dl 0
loc 22
rs 10
c 2
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCommand() 0 4 1
A run() 0 4 1
1
<?php
2
3
namespace Robo\Common;
4
5
use Robo\Contract\TaskInterface;
6
use Robo\Robo;
7
use Robo\Task\BaseTask;
8
9
class ProcessExecutor
10
{
11
    use ExecTrait;
12
    use TaskIO; // uses LoggerAwareTrait and ConfigAwareTrait
13
    use ProgressIndicatorAwareTrait;
14
15
    public function __construct($process)
16
    {
17
        $this->process = $process;
18
        $this->logger = Robo::logger();
19
    }
20
21
    public function getCommand()
22
    {
23
        return $this->process->getCommandLine();
24
    }
25
26
    public function run()
27
    {
28
        return $this->execute($this->getCommand());
29
    }
30
}
31