AppserverIo\Appserver\Core\Api\Node\ExecuteNode::__toString PHP Method

__toString() public method

Prepares the command to be excuted based on the script and the arguments.
public __toString ( ) : string
return string The command to execute
    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;
    }