src/Reporter/Terminal.php
public function write($string, $options = null)
    {
        $indent = str_repeat($this->_indentValue, $this->indent()) . $this->prefix();

        if ($newLine = ($string && $string[strlen($string) - 1] === "\n")) {
            $string = substr($string, 0, -1);
        }

        $string = str_replace("\n", "\n" . $indent, $string) . ($newLine ? "\n" : '');

        $indent = $this->_newLine ? $indent : '';
        $this->_newLine = $newLine;

        fwrite($this->_output, $indent . $this->format($string, $options));
    }
public function write($string, $options = null)
    {
        $indent = str_repeat($this->_indentValue, $this->indent()) . $this->prefix();

        if ($newLine = ($string && $string[strlen($string) - 1] === "\n")) {
            $string = substr($string, 0, -1);
        }

        $string = str_replace("\n", "\n" . $indent, $string) . ($newLine ? "\n" : '');

        $indent = $this->_newLine ? $indent : '';
        $this->_newLine = $newLine;

        fwrite($this->_output, $indent . $this->format($string, $options));
    }
public function write ( $ string , $ options = null ) { $ indent = str_repeat ( $ this -> _indentValue , $ this -> indent ( ) ) . $ this -> prefix ( ) ; if ( $ newLine = ( $ string && $ string [ strlen ( $ string ) - 1 ] === "\n" ) ) { $ string = substr ( $ string , 0 , - 1 ) ; } $ string = str_replace ( "\n" , "\n" . $ indent , $ string ) . ( $ newLine ? "\n" : '' ) ; $ indent = $ this -> _newLine ? $ indent : '' ; $ this -> _newLine = $ newLine ; fwrite ( $ this -> _output , $ indent . $ this -> format ( $ string , $ options ) ) ; }
Print a string to output.

@param string       $string  The string to print.
@param string|array $options The possible values for an array are:
- `'style`: a style code.
- `'color'`: a color code.
- `'background'`: a background color code.

The string must respect one of the following format:
- `'style;color;background'`
- `'style;color'`
- `'color'`
Print a string to output .