Skip to content
PHP Ecosystem
Explore

Json

API reference › Debug Core › Storage › Json

final classPHPForge\Debug\Storage\Json
Sourcesrc/Storage/Json.php

Converts strings to JSON-safe debug storage representations.

MethodDescriptionDefined by
payload() staticFreezes a provider payload as JSON values before it enters the request envelope.Json
safeString() staticReturns valid UTF-8, representing binary text as base64.Json
public static function payload(array<string, mixed> $payload): array<string, mixed>

Freezes a provider payload as JSON values before it enters the request envelope.

Strict encoding rejects invalid UTF-8, non-finite numbers, resources, cycles, and excessive depth. Decoding freezes nested serialization results so application callbacks never run again during storage. The depth limit reserves room for the request envelope. No redaction or truncation is applied here.

Parameters

ParameterTypeDescription
$payloadarray<string, mixed>

Returns

array<string, mixed>

public static function safeString(string $value): string

Returns valid UTF-8, representing binary text as base64.

Parameters

ParameterTypeDescription
$valuestringString to normalize.

Returns

string: JSON-safe string.