comparison vendor/symfony/console/Helper/ProcessHelper.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
13 13
14 use Symfony\Component\Console\Output\ConsoleOutputInterface; 14 use Symfony\Component\Console\Output\ConsoleOutputInterface;
15 use Symfony\Component\Console\Output\OutputInterface; 15 use Symfony\Component\Console\Output\OutputInterface;
16 use Symfony\Component\Process\Exception\ProcessFailedException; 16 use Symfony\Component\Process\Exception\ProcessFailedException;
17 use Symfony\Component\Process\Process; 17 use Symfony\Component\Process\Process;
18 use Symfony\Component\Process\ProcessBuilder;
19 18
20 /** 19 /**
21 * The ProcessHelper class provides helpers to run external processes. 20 * The ProcessHelper class provides helpers to run external processes.
22 * 21 *
23 * @author Fabien Potencier <fabien@symfony.com> 22 * @author Fabien Potencier <fabien@symfony.com>
42 $output = $output->getErrorOutput(); 41 $output = $output->getErrorOutput();
43 } 42 }
44 43
45 $formatter = $this->getHelperSet()->get('debug_formatter'); 44 $formatter = $this->getHelperSet()->get('debug_formatter');
46 45
47 if (is_array($cmd)) { 46 if ($cmd instanceof Process) {
48 $process = ProcessBuilder::create($cmd)->getProcess();
49 } elseif ($cmd instanceof Process) {
50 $process = $cmd; 47 $process = $cmd;
51 } else { 48 } else {
52 $process = new Process($cmd); 49 $process = new Process($cmd);
53 } 50 }
54 51