Completed
Push — master ( efd4b5...cdc15c )
by Greg
11s
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 Psr\Log\LoggerAwareInterface;
6
use Robo\Contract\ConfigAwareInterface;
7
use Robo\Contract\OutputAwareInterface;
8
use Robo\Contract\VerbosityThresholdInterface;
9
use Symfony\Component\Process\Process;
10
11
class ProcessExecutor implements ConfigAwareInterface, LoggerAwareInterface, OutputAwareInterface, VerbosityThresholdInterface
12
{
13
    use ExecTrait;
14
    use TaskIO; // uses LoggerAwareTrait and ConfigAwareTrait
15
    use ProgressIndicatorAwareTrait;
16
    use OutputAwareTrait;
17
18
    public function __construct(Process $process)
19
    {
20
        $this->process = $process;
21
    }
22
23
    /**
24
     * @return string
25
     */
26
    protected function getCommandDescription()
27
    {
28
        return $this->process->getCommandLine();
29
    }
30
31
    public function run()
32
    {
33
        return $this->execute($this->process);
34
    }
35
}
36