src/Web/Formatters/JsonResponseFormatter.php
protected function formatJson($response)
    {
        $bodyRaw = $response->getRawBody();
        if ($bodyRaw !== null) {
            $options = $this->encodeOptions;
            if ($this->prettyPrint) {
                $options |= JSON_PRETTY_PRINT;
            }
            return $response->app instanceof Reaction\RequestApplicationInterface
                ? $response->app->helpers->json->encode($bodyRaw, $options)
                : Json::encode($bodyRaw, $options);
        }
        return '';
    }
protected function formatJson($response)
    {
        $bodyRaw = $response->getRawBody();
        if ($bodyRaw !== null) {
            $options = $this->encodeOptions;
            if ($this->prettyPrint) {
                $options |= JSON_PRETTY_PRINT;
            }
            return $response->app instanceof Reaction\RequestApplicationInterface
                ? $response->app->helpers->json->encode($bodyRaw, $options)
                : Json::encode($bodyRaw, $options);
        }
        return '';
    }
Formats response data in JSON format.
@param ResponseBuilderInterface $response
@return string