/** * Returns the full command. * * @return string * * @throws \YapepBase\Exception\Shell\Exception If no command is set. */ public function getCommand() { $command = escapeshellarg($this->command); foreach ($this->commandParams as $param) { if (strlen($param['option']) > 0) { $command .= ' ' . $param['option']; if (strlen($param['value']) > 0) { $command .= $this->switchValueSeparator . escapeshellarg($param['value']); } } else { $command .= ' ' . escapeshellarg($param['value']); } } foreach ($this->outputRedirections as $type => $target) { $command .= ' ' . $type . ' ' . $target; } if (!empty($this->chainedCommand)) { $command .= ' ' . $this->chainedCommandOperator . ' ' . $this->chainedCommand->getCommand(); } return $command; }