From c5a02a2b58e6de877f4a43c92d4650129bd01fba Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 18 Aug 2021 14:48:20 +0200 Subject: [PATCH] Fix return value of ProcessExecutor::getErrorOutput, closes #10054 --- src/Composer/Util/ProcessExecutor.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Composer/Util/ProcessExecutor.php b/src/Composer/Util/ProcessExecutor.php index 7d7e6546e..03c5aa519 100644 --- a/src/Composer/Util/ProcessExecutor.php +++ b/src/Composer/Util/ProcessExecutor.php @@ -33,8 +33,11 @@ class ProcessExecutor protected static $timeout = 300; - protected $captureOutput; - protected $errorOutput; + /** @var bool */ + protected $captureOutput = false; + /** @var string */ + protected $errorOutput = ''; + /** @var ?IOInterface */ protected $io; /** @@ -111,7 +114,7 @@ class ProcessExecutor } $this->captureOutput = func_num_args() > 3; - $this->errorOutput = null; + $this->errorOutput = ''; // TODO in v3, commands should be passed in as arrays of cmd + args if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) {