src/Rocketeer/Binaries/AbstractBinary.php
public function getCommand($command = null, $arguments = [], $flags = [], $environmentVariables = [])
    {
        // Format arguments
        $arguments = $this->buildArguments($arguments);
        $options = $this->buildOptions($flags);
        $environmentVariables = $this->buildEnvironmentVariables($environmentVariables);

        // Build command
        $binary = $this->getBinary();
        $components = [$command, $arguments, $options];
        foreach ($components as $component) {
            if ($component) {
                $binary .= ' '.$component;
            }
        }

        // If the binary has a parent, wrap the call with it
        $parent = $this->parent instanceof self ? $this->parent->getBinary() : $this->parent;
        $command = $environmentVariables.$parent.' '.$binary;

        return trim($command);
    }
public function getCommand($command = null, $arguments = [], $flags = [], $environmentVariables = [])
    {
        // Format arguments
        $arguments = $this->buildArguments($arguments);
        $options = $this->buildOptions($flags);
        $environmentVariables = $this->buildEnvironmentVariables($environmentVariables);

        // Build command
        $binary = $this->getBinary();
        $components = [$command, $arguments, $options];
        foreach ($components as $component) {
            if ($component) {
                $binary .= ' '.$component;
            }
        }

        // If the binary has a parent, wrap the call with it
        $parent = $this->parent instanceof self ? $this->parent->getBinary() : $this->parent;
        $command = $environmentVariables.$parent.' '.$binary;

        return trim($command);
    }
public function getCommand ( $ command = null , $ arguments = [ ] , $ flags = [ ] , $ environmentVariables = [ ] ) { // Format arguments $ arguments = $ this -> buildArguments ( $ arguments ) ; $ options = $ this -> buildOptions ( $ flags ) ; $ environmentVariables = $ this -> buildEnvironmentVariables ( $ environmentVariables ) ; // Build command $ binary = $ this -> getBinary ( ) ; $ components = [ $ command , $ arguments , $ options ] ; foreach ( $ components as $ component ) { if ( $ component ) { $ binary .= ' ' . $ component ; } } // If the binary has a parent, wrap the call with it $ parent = $ this -> parent instanceof self ? $ this -> parent -> getBinary ( ) : $ this -> parent ; $ command = $ environmentVariables . $ parent . ' ' . $ binary ; return trim ( $ command ) ; }
Returns a command with the VCS's binary.

@param string|null     $command
@param string|string[] $arguments
@param string|string[] $flags
@param array           $environmentVariables

@return string
Returns a command with the VCS s binary .