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
1 changed files with 4 additions and 0 deletions

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)
{
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) {
$output = $output->getErrorOutput();
}