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;
11 class ProcessExecutor implements ConfigAwareInterface, LoggerAwareInterface, OutputAwareInterface, VerbosityThresholdInterface
14 use TaskIO; // uses LoggerAwareTrait and ConfigAwareTrait
15 use ProgressIndicatorAwareTrait;
19 * @param Process $process
22 public function __construct(Process $process)
24 $this->process = $process;
27 public static function create($container, $process)
29 $processExecutor = new self($process);
31 $processExecutor->setLogger($container->get('logger'));
32 $processExecutor->setProgressIndicator($container->get('progressIndicator'));
33 $processExecutor->setConfig($container->get('config'));
34 $processExecutor->setOutputAdapter($container->get('outputAdapter'));
36 return $processExecutor;
42 protected function getCommandDescription()
44 return $this->process->getCommandLine();
49 return $this->execute($this->process);