function ArrayInput::__toString
Returns a stringified representation of the args passed to the command.
Overrides InputInterface::__toString
File
-
vendor/
symfony/ console/ Input/ ArrayInput.php, line 93
Class
- ArrayInput
- ArrayInput represents an input provided as an array.
Namespace
Symfony\Component\Console\InputCode
public function __toString() : string {
$params = [];
foreach ($this->parameters as $param => $val) {
if ($param && \is_string($param) && '-' === $param[0]) {
$glue = '-' === $param[1] ? '=' : ' ';
if (\is_array($val)) {
foreach ($val as $v) {
$params[] = $param . ('' != $v ? $glue . $this->escapeToken($v) : '');
}
}
else {
$params[] = $param . ('' != $val ? $glue . $this->escapeToken($val) : '');
}
}
else {
$params[] = \is_array($val) ? implode(' ', array_map($this->escapeToken(...), $val)) : $this->escapeToken($val);
}
}
return implode(' ', $params);
}