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

ProcessExecutor   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getCommand() 0 3 1
A run() 0 3 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
        return $this->process->getCommandLine();
23
    }
24
25
    public function run() {
26
        return $this->execute($this->getCommand());
27
    }
28
}
29