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

ProcessExecutor::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 5
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 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->process);
29
    }
30
}
31