Skip to content
PHP Ecosystem
Explore

QueueSnapshot

API reference › Debug Core › Panel › Queue › QueueSnapshot

final readonly classPHPForge\Debug\Panel\Queue\QueueSnapshot
ImplementsPHPForge\Debug\Storage\PanelSnapshot
Sourcesrc/Panel/Queue/QueueSnapshot.php

Canonical Queue panel snapshot holding the captured job events in their typed form.

MethodDescriptionDefined by
__construct()Creates a queue snapshot from captured job events.QueueSnapshot
capture() staticNarrows the captured queue-event payloads into typed records.QueueSnapshot
entries()Returns the captured queue lifecycle events.QueueSnapshot
fromArray() staticNarrows the persisted queue payload into a typed snapshot.QueueSnapshot
jsonSerialize()Returns the panel snapshot for JSON serialization.QueueSnapshot
public function __construct(list<PHPForge\Debug\Panel\Queue\JobRecord> $entries)

Creates a queue snapshot from captured job events.

Parameters

ParameterTypeDescription
$entrieslist<JobRecord>
public static function capture(array<array-key, mixed> $records): self

Narrows the captured queue-event payloads into typed records.

Parameters

ParameterTypeDescription
$recordsarray<array-key, mixed>Captured payloads in event order; non-array entries are dropped.

Returns

self

public function entries(): list<PHPForge\Debug\Panel\Queue\JobRecord>

Returns the captured queue lifecycle events.

Returns

list<JobRecord>: Captured job events in event order.

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

Narrows the persisted queue 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 job events.

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

Returns the panel snapshot for JSON serialization.

Returns

array<string, mixed>