Skip to content
PHP Ecosystem
Explore

EventSnapshot

API reference › Debug Core › Panel › Event › EventSnapshot

final readonly classPHPForge\Debug\Panel\Event\EventSnapshot
ImplementsPHPForge\Debug\Storage\PanelSnapshot
Sourcesrc/Panel/Event/EventSnapshot.php

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

MethodDescriptionDefined by
__construct()Creates a snapshot from the captured event rows.EventSnapshot
entries()Returns the captured event rows.EventSnapshot
fromArray() staticHydrates the Event panel snapshot from decoded JSON data.EventSnapshot
jsonSerialize()Returns the snapshot for JSON serialization.EventSnapshot
public function __construct(list<PHPForge\Debug\Panel\Event\EventRow> $entries)

Creates a snapshot from the captured event rows.

Parameters

ParameterTypeDescription
$entrieslist<EventRow>Captured rows in fire order.
public function entries(): list<PHPForge\Debug\Panel\Event\EventRow>

Returns the captured event rows.

Returns

list<EventRow>: Captured rows in fire order.

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

Hydrates the Event panel snapshot from decoded JSON data.

Parameters

ParameterTypeDescription
$datamixedDecoded Event panel payload.
$pathstringPayload path used in hydration errors.

Returns

self: Hydrated snapshot carrying the typed rows.

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

Returns the snapshot for JSON serialization.

Returns

array<string, mixed>: Serialized event rows in fire order.