- WIP on Dump() encoder

This commit is contained in:
Dave Mc Nicoll 2024-11-01 16:13:18 -04:00
parent b99ff24d26
commit eb378eb21e
1 changed files with 3 additions and 1 deletions

View File

@ -52,7 +52,9 @@ namespace Dump {
}
if (isset($dump)) {
$stream->write(json_encode(array_merge(["_dump" => $dump ?? []], json_decode($body->getContents() ?? "{}", true)), JsonResponse::DEFAULT_JSON_FLAGS));
$json = json_encode(array_merge(["_dump" => $dump ], json_decode($body->getContents() ?? "{}", true)), JsonResponse::DEFAULT_JSON_FLAGS);
$stream->write(! is_string($json) ? json_encode($json, JsonResponse::DEFAULT_JSON_FLAGS) : $json);
}
$stream->append_resource($body->detach());