Skip to content
PHP Ecosystem
Explore

DebugSnapshot

API reference › Debug Core › Storage › DebugSnapshot

final readonly classPHPForge\Debug\Storage\DebugSnapshot
ImplementsJsonSerializable
Sourcesrc/Storage/DebugSnapshot.php

Represents the versioned envelope persisted for one captured request.

PropertyTypeDescriptionDefined by
$failures readonly constructorarray<string, PanelFailure>Panel failures indexed by panel ID.DebugSnapshot
$panels readonly constructorarray<string, array<string, mixed>>Serialized panel payloads indexed by panel ID.DebugSnapshot
$summary readonly constructorRequestSummaryCaptured request metadata.DebugSnapshot
MethodDescriptionDefined by
__construct()Creates a versioned envelope for a captured request.DebugSnapshot
fromArray() staticHydrates a versioned request envelope from decoded JSON data.DebugSnapshot
jsonSerialize()Returns the request envelope for JSON serialization.DebugSnapshot
ConstantValueDescriptionDefined by
VERSION4DebugSnapshot
public function __construct(PHPForge\Debug\Storage\RequestSummary $summary, array<string, array<string, mixed>> $panels, array<string, PHPForge\Debug\Storage\PanelFailure> $failures)

Creates a versioned envelope for a captured request.

Parameters

ParameterTypeDescription
$summaryRequestSummaryCaptured request metadata.
$panelsarray<string, array<string, mixed>>Serialized panel payloads indexed by panel ID.
$failuresarray<string, PanelFailure>Panel failures indexed by panel ID.
public static function fromArray(mixed $data): self

Hydrates a versioned request envelope from decoded JSON data.

Parameters

ParameterTypeDescription
$datamixedDecoded snapshot envelope.

Returns

self: Hydrated request snapshot.

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

Returns the request envelope for JSON serialization.

Returns

array<string, mixed>: Versioned request envelope.