Skip to content
PHP Ecosystem
Explore

ArrayPayloadSnapshot

API reference › Debug Core › Storage › ArrayPayloadSnapshot

traitPHPForge\Debug\Storage\ArrayPayloadSnapshot
Sourcesrc/Storage/ArrayPayloadSnapshot.php
Used by 2 types

Provides the capture/hydrate/serialize cycle for panels whose payload stays genuinely dynamic (application configuration, dumped values, and user-configured request globals).

MethodDescriptionDefined by
__construct() finalCreates a snapshot from a tagged dynamic payload.ArrayPayloadSnapshot
capture() staticCaptures arbitrary array values in a JSON-safe snapshot.ArrayPayloadSnapshot
fromArray() staticHydrates a dynamic payload from decoded JSON data.ArrayPayloadSnapshot
jsonSerialize()Returns the tagged payload for JSON serialization.ArrayPayloadSnapshot
payloadKey() protected static abstractReturns the JSON key used to persist the dynamic payload.ArrayPayloadSnapshot
final public function __construct(PHPForge\Debug\Storage\DebugArray $payload)

Creates a snapshot from a tagged dynamic payload.

Parameters

ParameterTypeDescription
$payloadDebugArrayTagged dynamic payload.
public static function capture(array<array-key, mixed> $values): self

Captures arbitrary array values in a JSON-safe snapshot.

Parameters

ParameterTypeDescription
$valuesarray<array-key, mixed>Raw payload captured for the request.

Returns

self: Snapshot containing tagged debug values.

public static function fromArray(mixed $data, string $path): self

Hydrates a dynamic payload from decoded JSON data.

Parameters

ParameterTypeDescription
$datamixedDecoded JSON payload.
$pathstringPayload path used in hydration errors.

Returns

self: Hydrated dynamic payload snapshot.

public function jsonSerialize(): array<string, mixed>

Returns the tagged payload for JSON serialization.

Returns

array<string, mixed>: Tagged payload indexed by its persistence key.

abstract protected static function payloadKey(): string

Returns the JSON key used to persist the dynamic payload.

Returns

string: Persisted payload key.