src/Http/Response/Format/Json.php
protected function encode($content)
    {
        $jsonEncodeOptions = [];

        // Here is a place, where any available JSON encoding options, that
        // deal with users' requirements to JSON response formatting and
        // structure, can be conveniently applied to tweak the output.

        if ($this->isJsonPrettyPrintEnabled()) {
            $jsonEncodeOptions[] = JSON_PRETTY_PRINT;
        }

        $encodedString = $this->performJsonEncoding($content, $jsonEncodeOptions);

        if ($this->isCustomIndentStyleRequired()) {
            $encodedString = $this->indentPrettyPrintedJson(
                $encodedString,
                $this->options['indent_style']
            );
        }

        return $encodedString;
    }
protected function encode($content)
    {
        $jsonEncodeOptions = [];

        // Here is a place, where any available JSON encoding options, that
        // deal with users' requirements to JSON response formatting and
        // structure, can be conveniently applied to tweak the output.

        if ($this->isJsonPrettyPrintEnabled()) {
            $jsonEncodeOptions[] = JSON_PRETTY_PRINT;
        }

        $encodedString = $this->performJsonEncoding($content, $jsonEncodeOptions);

        if ($this->isCustomIndentStyleRequired()) {
            $encodedString = $this->indentPrettyPrintedJson(
                $encodedString,
                $this->options['indent_style']
            );
        }

        return $encodedString;
    }
protected function encode ( $ content ) { $ jsonEncodeOptions = [ ] ; // Here is a place, where any available JSON encoding options, that // deal with users' requirements to JSON response formatting and // structure, can be conveniently applied to tweak the output. if ( $ this -> isJsonPrettyPrintEnabled ( ) ) { $ jsonEncodeOptions [ ] = JSON_PRETTY_PRINT ; } $ encodedString = $ this -> performJsonEncoding ( $ content , $ jsonEncodeOptions ) ; if ( $ this -> isCustomIndentStyleRequired ( ) ) { $ encodedString = $ this -> indentPrettyPrintedJson ( $ encodedString , $ this -> options [ 'indent_style' ] ) ; } return $ encodedString ; }
Encode the content to its JSON representation.

@param mixed $content

@return string
Encode the content to its JSON representation .