src/Rocketeer/Services/Connections/Shell/Modules/Core.php
protected function processOutput($output, $array = false, $trim = true)
    {
        // Remove polluting strings
        $output = $this->cleanOutput($output);

        // Explode output if necessary
        if ($array) {
            $delimiter = $this->environment->getLineEndings() ?: PHP_EOL;
            $output = explode($delimiter, $output);
        }

        // Trim output
        if ($trim) {
            $output = is_array($output)
                ? array_filter($output)
                : trim($output);
        }

        return $output;
    }
protected function processOutput($output, $array = false, $trim = true)
    {
        // Remove polluting strings
        $output = $this->cleanOutput($output);

        // Explode output if necessary
        if ($array) {
            $delimiter = $this->environment->getLineEndings() ?: PHP_EOL;
            $output = explode($delimiter, $output);
        }

        // Trim output
        if ($trim) {
            $output = is_array($output)
                ? array_filter($output)
                : trim($output);
        }

        return $output;
    }
protected function processOutput ( $ output , $ array = false , $ trim = true ) { // Remove polluting strings $ output = $ this -> cleanOutput ( $ output ) ; // Explode output if necessary if ( $ array ) { $ delimiter = $ this -> environment -> getLineEndings ( ) ? : PHP_EOL ; $ output = explode ( $ delimiter , $ output ) ; } // Trim output if ( $ trim ) { $ output = is_array ( $ output ) ? array_filter ( $ output ) : trim ( $ output ) ; } return $ output ; }
Process the output of a command.

@param string $output
@param bool   $array  Whether to return an array or a string
@param bool   $trim   Whether to trim the output or not

@return string|array
Process the output of a command .