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

ProcessExecutor::run()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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