ArrayPayloadSnapshot
API reference › Debug Core › Storage › ArrayPayloadSnapshot
Provides the capture/hydrate/serialize cycle for panels whose payload stays genuinely dynamic (application configuration, dumped values, and user-configured request globals).
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() final | Creates a snapshot from a tagged dynamic payload. | ArrayPayloadSnapshot |
capture() static | Captures arbitrary array values in a JSON-safe snapshot. | ArrayPayloadSnapshot |
fromArray() static | Hydrates a dynamic payload from decoded JSON data. | ArrayPayloadSnapshot |
jsonSerialize() | Returns the tagged payload for JSON serialization. | ArrayPayloadSnapshot |
payloadKey() protected static abstract | Returns the JSON key used to persist the dynamic payload. | ArrayPayloadSnapshot |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”final public function __construct(PHPForge\Debug\Storage\DebugArray $payload)Creates a snapshot from a tagged dynamic payload.
Parameters
| Parameter | Type | Description |
|---|---|---|
$payload | DebugArray | Tagged dynamic payload. |
capture()
Section titled “capture() ”public static function capture(array<array-key, mixed> $values): selfCaptures arbitrary array values in a JSON-safe snapshot.
Parameters
| Parameter | Type | Description |
|---|---|---|
$values | array<array-key, | Raw payload captured for the request. |
Returns
self: Snapshot containing tagged debug values.
fromArray()
Section titled “fromArray() ”public static function fromArray(mixed $data, string $path): selfHydrates a dynamic payload from decoded JSON data.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | Decoded JSON payload. |
$path | string | Payload path used in hydration errors. |
Returns
self: Hydrated dynamic payload snapshot.
jsonSerialize()
Section titled “jsonSerialize() ”public function jsonSerialize(): array<string, mixed>Returns the tagged payload for JSON serialization.
Returns
array<string, mixed>: Tagged payload indexed by its persistence key.
payloadKey()
Section titled “payloadKey() ”abstract protected static function payloadKey(): stringReturns the JSON key used to persist the dynamic payload.
Returns
string: Persisted payload key.