Skip to content

Commit 7a1427b

Browse files
committed
Adding notes in the PR
1 parent 76600fe commit 7a1427b

1 file changed

Lines changed: 2 additions & 20 deletions

File tree

‎helpers.php‎

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ function json_optimize_decode(string $json, bool $assoc = false, int $depth = 51
315315

316316
if (!function_exists('json_optimize_encode')) {
317317
/**
318-
* Encodes a value into a JSON using simdjson if available.
318+
* Currently, we're using PHP's native json_encode.
319+
* We need to investigate alternative libraries or methods to boost its performance.
319320
*
320321
* @param mixed $value
321322
* @param int $flags
@@ -327,22 +328,3 @@ function json_optimize_encode(mixed $value, int $flags = 0, int $depth = 512): s
327328
return JsonOptimizer::encode($value, $flags, $depth);
328329
}
329330
}
330-
331-
if (!function_exists('response_json_optimize')) {
332-
/**
333-
* Encodes a value into a JSON using simdjson if available.
334-
*
335-
* @param mixed $data
336-
* @param int $status
337-
* @param array $headers
338-
* @return \Illuminate\Http\Response
339-
*/
340-
function response_json_optimize($data, int $status = 200, array $headers = [])
341-
{
342-
$json = json_optimize_encode($data);
343-
344-
return response($json, $status)
345-
->header('Content-Type', 'application/json')
346-
->withHeaders($headers);
347-
}
348-
}

0 commit comments

Comments
 (0)