src/Leevel/Http/Response.php
protected function contentToJson($content): string
    {
        if ($content instanceof IJson) {
            return $content->toJson();
        }

        if ($content instanceof IArray) {
            $content = $content->toArray();
        }

        return json_encode($content, JSON_UNESCAPED_UNICODE);
    }
protected function contentToJson($content): string
    {
        if ($content instanceof IJson) {
            return $content->toJson();
        }

        if ($content instanceof IArray) {
            $content = $content->toArray();
        }

        return json_encode($content, JSON_UNESCAPED_UNICODE);
    }
内容转换为 JSON.

@param mixed $content

@return string