src/AbstractJsonEncoder.php
public function setIndent($indent)
    {
        if ($this->step !== null) {
            throw new \RuntimeException('Cannot change indent during encoding');
        }

        $this->indent = is_int($indent) ? str_repeat(' ', $indent) : (string) $indent;
        return $this;
    }
public function setIndent($indent)
    {
        if ($this->step !== null) {
            throw new \RuntimeException('Cannot change indent during encoding');
        }

        $this->indent = is_int($indent) ? str_repeat(' ', $indent) : (string) $indent;
        return $this;
    }
public function setIndent ( $ indent ) { if ( $ this -> step !== null ) { throw new \ RuntimeException ( 'Cannot change indent during encoding' ) ; } $ this -> indent = is_int ( $ indent ) ? str_repeat ( ' ' , $ indent ) : ( string ) $ indent ; return $ this ; }
Sets the indent for the JSON output.
@param string|int $indent A string to use as indent or the number of spaces
@return $this Returns self for call chaining
@throws \RuntimeException If changing indent during encoding operation
Sets the indent for the JSON output .