Add meaningful message when Process is not installed (ProcessHelper)

This commit is contained in:
Laurent VOULLEMIER 2020-05-28 22:44:39 +02:00 committed by Fabien Potencier
parent 03cad5a750
commit 3ab76e40ff

View File

@ -37,6 +37,10 @@ class ProcessHelper extends Helper
*/ */
public function run(OutputInterface $output, $cmd, $error = null, callable $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE) public function run(OutputInterface $output, $cmd, $error = null, callable $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE)
{ {
if (!class_exists(Process::class)) {
throw new \LogicException('The Process helper requires the "Process" component. Install "symfony/process" to use it.');
}
if ($output instanceof ConsoleOutputInterface) { if ($output instanceof ConsoleOutputInterface) {
$output = $output->getErrorOutput(); $output = $output->getErrorOutput();
} }