Completed
Pull Request — master (#536)
by
unknown
03:34
created

ProcessExecutor   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 7

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 7
dl 0
loc 26
rs 10
c 0
b 0
f 0

3 Methods

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