public function __toString()
{
// initialize the command with the script name
$command = $this->script;
// append the arguments
/** @var \AppserverIo\Appserver\Core\Api\Node\ArgNode $arg */
foreach ($this->getArgs() as $arg) {
if ($name = $arg->getName()) {
$command .= ' ' . $name;
}
if ($value = $arg->castToType()) {
$command .= ' ' . $value;
}
}
// return the initialized command
return $command;
}