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;
    }
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;
    }
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 ; }
Get a string representation of this command with its arguments,
as if it would be written in a command-line interface when run.

@param  bool $includePiped (Optional) indicates whether the resulting
string will include any piped command to this
one. Defaults to FALSE.

@return string
Get a string representation of this command with its arguments as if it would be written in a command - line interface when run .