public function toCommandString($includePiped = false)
{
$command = $this->getName();
if (!$this->getArguments()->isEmpty()) {
$args = array();
$delimiter = $this->getOption('delimiter', self::DEFAULT_DELIMITER);
foreach ($this->getArguments()->getAll() as $key => $value) {
if (is_int($key)) {
$args[] = $value;
} else {
$args[] = $key . $delimiter . $value;
}
}
$command .= ' ' . implode(' ', $args);
}
if ($includePiped && $this->hasPipedCommand()) {
$command .= sprintf(' %s %s', self::PIPE, $this->getPipedCommand()->toCommandString($includePiped));
}
return $command;
}