
| Current Path : /var/www/html/ift/vendor/consolidation/robo/src/Common/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/ift/vendor/consolidation/robo/src/Common/ProcessExecutor.php |
<?php
namespace Robo\Common;
use Psr\Log\LoggerAwareInterface;
use Robo\Contract\ConfigAwareInterface;
use Robo\Contract\OutputAwareInterface;
use Robo\Contract\VerbosityThresholdInterface;
use Symfony\Component\Process\Process;
class ProcessExecutor implements ConfigAwareInterface, LoggerAwareInterface, OutputAwareInterface, VerbosityThresholdInterface
{
use ExecTrait;
use TaskIO; // uses LoggerAwareTrait and ConfigAwareTrait
use ProgressIndicatorAwareTrait;
use OutputAwareTrait;
/**
* @param \Symfony\Component\Process\Process $process
*/
public function __construct(Process $process)
{
$this->process = $process;
}
/**
* @param \League\Container\ContainerInterface $container
* @param \Symfony\Component\Process\Process $process
*
* @return static
*/
public static function create($container, $process)
{
$processExecutor = new self($process);
$processExecutor->setLogger($container->get('logger'));
$processExecutor->setProgressIndicator($container->get('progressIndicator'));
$processExecutor->setConfig($container->get('config'));
$processExecutor->setOutputAdapter($container->get('outputAdapter'));
return $processExecutor;
}
/**
* {@inheritdoc}
*/
protected function getCommandDescription()
{
return $this->process->getCommandLine();
}
public function run()
{
return $this->execute($this->process);
}
}