From 16aaeae728d6079e26a9ed7d5854618550c13247 Mon Sep 17 00:00:00 2001 From: BELADEL ILYES ABDELRAZAK Date: Sat, 13 Mar 2021 10:59:38 +0100 Subject: [PATCH 1/2] Fix getExecCommand() to get the latest command set instead only the first one passed. --- src/Command.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Command.php b/src/Command.php index 7fe4380..49734b0 100644 --- a/src/Command.php +++ b/src/Command.php @@ -232,15 +232,15 @@ public function getCommand() */ public function getExecCommand() { - if ($this->_execCommand===null) { - $command = $this->getCommand(); - if (!$command) { - $this->_error = 'Could not locate any executable command'; - return false; - } - $args = $this->getArgs(); - $this->_execCommand = $args ? $command.' '.$args : $command; + $command = $this->getCommand(); + if (!$command) { + $this->_error = 'Could not locate any executable command'; + return false; } + + $args = $this->getArgs(); + $this->_execCommand = $args ? $command.' '.$args : $command; + return $this->_execCommand; } From 718d1872691cebcaae257a63a31fb7a0ead60d00 Mon Sep 17 00:00:00 2001 From: Beladel ilyes Abdelrazak Date: Tue, 16 Mar 2021 22:56:22 +0100 Subject: [PATCH 2/2] Remove `_execCommand` property --- src/Command.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Command.php b/src/Command.php index 49734b0..c552724 100644 --- a/src/Command.php +++ b/src/Command.php @@ -97,11 +97,6 @@ class Command */ protected $_args = array(); - /** - * @var string the full command string to execute - */ - protected $_execCommand; - /** * @var string the stdout output */ @@ -239,9 +234,7 @@ public function getExecCommand() } $args = $this->getArgs(); - $this->_execCommand = $args ? $command.' '.$args : $command; - - return $this->_execCommand; + return $args ? $command.' '.$args : $command; } /**