src/AbstractJsonEncoder.php
private function output($string, $token)
    {
        if ($this->newLine && $this->options & JSON_PRETTY_PRINT) {
            $indent = str_repeat($this->indent, count($this->stack));
            $this->write("\n", JsonToken::T_WHITESPACE);

            if ($indent !== '') {
                $this->write($indent, JsonToken::T_WHITESPACE);
            }

            $this->line++;
            $this->column = strlen($indent) + 1;
        }

        $this->newLine = false;
        $this->write($string, $token);
        $this->column += strlen($string);
    }
private function output($string, $token)
    {
        if ($this->newLine && $this->options & JSON_PRETTY_PRINT) {
            $indent = str_repeat($this->indent, count($this->stack));
            $this->write("\n", JsonToken::T_WHITESPACE);

            if ($indent !== '') {
                $this->write($indent, JsonToken::T_WHITESPACE);
            }

            $this->line++;
            $this->column = strlen($indent) + 1;
        }

        $this->newLine = false;
        $this->write($string, $token);
        $this->column += strlen($string);
    }
private function output ( $ string , $ token ) { if ( $ this -> newLine && $ this -> options & JSON_PRETTY_PRINT ) { $ indent = str_repeat ( $ this -> indent , count ( $ this -> stack ) ) ; $ this -> write ( "\n" , JsonToken :: T_WHITESPACE ) ; if ( $ indent !== '' ) { $ this -> write ( $ indent , JsonToken :: T_WHITESPACE ) ; } $ this -> line ++ ; $ this -> column = strlen ( $ indent ) + 1 ; } $ this -> newLine = false ; $ this -> write ( $ string , $ token ) ; $ this -> column += strlen ( $ string ) ; }
Passes the given token to the output stream.
@param string $string The token to write to the output stream
@param int $token The type of the token
Passes the given token to the output stream .