Skip to content
PHP Ecosystem
Explore

DumpSnapshot

API reference › Debug Core › Panel › Dump › DumpSnapshot

final readonly classPHPForge\Debug\Panel\Dump\DumpSnapshot
ImplementsPHPForge\Debug\Storage\PanelSnapshot
Sourcesrc/Panel/Dump/DumpSnapshot.php

Canonical Dump panel snapshot holding the captured rows in their typed form.

MethodDescriptionDefined by
__construct()Creates a dump snapshot from captured rows.DumpSnapshot
capture() staticConverts canonical logger tuples into typed rows.DumpSnapshot
entries()Returns the captured dump rows.DumpSnapshot
fromArray() staticNarrows the persisted dump payload into a typed snapshot.DumpSnapshot
jsonSerialize()Returns the panel snapshot for JSON serialization.DumpSnapshot
public function __construct(list<PHPForge\Debug\Panel\Dump\DumpRow> $entries)

Creates a dump snapshot from captured rows.

Parameters

ParameterTypeDescription
$entrieslist<DumpRow>
public static function capture(list<PHPForge\Debug\Panel\Dump\LogTuple> $messages): self

Converts canonical logger tuples into typed rows.

Parameters

ParameterTypeDescription
$messageslist<PHPForge\Debug\Panel\Dump\LogTuple>Logger tuples in capture order.

Returns

self

public function entries(): list<PHPForge\Debug\Panel\Dump\DumpRow>

Returns the captured dump rows.

Returns

list<DumpRow>: Captured rows in capture order.

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

Narrows the persisted dump payload into a typed snapshot.

Parameters

ParameterTypeDescription
$datamixedPersisted payload, expected to be an object carrying an entries list.
$pathstringJSON path of the payload, used to report a malformed capture.

Returns

self: Snapshot carrying the persisted dump rows.

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

Returns the panel snapshot for JSON serialization.

Returns

array<string, mixed>