Skip to content

Commit 3488d78

Browse files
authored
Merge pull request #55 from hAbd0u/fix-setCommand
Fix getExecCommand() to get the latest command set instead only the first…
2 parents fe86ec8 + 718d187 commit 3488d78

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

src/Command.php

+7-14
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@ class Command
9797
*/
9898
protected $_args = array();
9999

100-
/**
101-
* @var string the full command string to execute
102-
*/
103-
protected $_execCommand;
104-
105100
/**
106101
* @var string the stdout output
107102
*/
@@ -232,16 +227,14 @@ public function getCommand()
232227
*/
233228
public function getExecCommand()
234229
{
235-
if ($this->_execCommand===null) {
236-
$command = $this->getCommand();
237-
if (!$command) {
238-
$this->_error = 'Could not locate any executable command';
239-
return false;
240-
}
241-
$args = $this->getArgs();
242-
$this->_execCommand = $args ? $command.' '.$args : $command;
230+
$command = $this->getCommand();
231+
if (!$command) {
232+
$this->_error = 'Could not locate any executable command';
233+
return false;
243234
}
244-
return $this->_execCommand;
235+
236+
$args = $this->getArgs();
237+
return $args ? $command.' '.$args : $command;
245238
}
246239

247240
/**

0 commit comments

Comments
 (0)