src/Http/Response/Format/JsonOptionalFormatting.php
protected function peformIndentation($jsonString, $indentChar = "\t", $indentSize = 1, $defaultSpaces = 4)
    {
        $pattern = '/(^|\G) {'.$defaultSpaces.'}/m';
        $replacement = str_repeat($indentChar, $indentSize).'$1';

        return preg_replace($pattern, $replacement, $jsonString);
    }
protected function peformIndentation($jsonString, $indentChar = "\t", $indentSize = 1, $defaultSpaces = 4)
    {
        $pattern = '/(^|\G) {'.$defaultSpaces.'}/m';
        $replacement = str_repeat($indentChar, $indentSize).'$1';

        return preg_replace($pattern, $replacement, $jsonString);
    }
protected function peformIndentation ( $ jsonString , $ indentChar = "\t" , $ indentSize = 1 , $ defaultSpaces = 4 ) { $ pattern = '/(^|\G) {' . $ defaultSpaces . '}/m' ; $ replacement = str_repeat ( $ indentChar , $ indentSize ) . '$1' ; return preg_replace ( $ pattern , $ replacement , $ jsonString ) ; }
Perform indentation for pretty printed JSON string with a given
indent char, repeated N times, as determined by indent size.

@param string $jsonString    JSON string, which must be indented
@param string $indentChar    Char, used for indent (default is tab)
@param int    $indentSize    Number of times to repeat indent char per one indent level
@param int    $defaultSpaces Default number of indent spaces after json_encode()

@return string
Perform indentation for pretty printed JSON string with a given indent char repeated N times as determined by indent size .