Skip to content
PHP Ecosystem
Explore

PanelFailure

API reference › Debug Core › Storage › PanelFailure

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

Captures a panel failure without invalidating the remaining request snapshot.

PropertyTypeDescriptionDefined by
$exception readonly constructorExceptionSnapshotCaptured panel exception.PanelFailure
$stage readonly constructor"capture"|"hydrate"Lifecycle stage the panel failed in.PanelFailure
MethodDescriptionDefined by
__construct()Creates a panel failure record.PanelFailure
fromArray() staticHydrates a panel failure from decoded JSON data.PanelFailure
fromThrowable() staticCaptures a throwable raised during a panel lifecycle stage.PanelFailure
jsonSerialize()Returns the failure record for JSON serialization.PanelFailure
ConstantValueDescriptionDefined by
CAPTURE'capture'Lifecycle stage indicating the panel was captured.PanelFailure
HYDRATE'hydrate'Lifecycle stage indicating the panel was hydrated.PanelFailure
public function __construct("capture"|"hydrate" $stage, PHPForge\Debug\Storage\ExceptionSnapshot $exception)

Creates a panel failure record.

Parameters

ParameterTypeDescription
$stage"capture"|"hydrate"Lifecycle stage the panel failed in.
$exceptionExceptionSnapshotCaptured panel exception.
public static function fromArray(mixed $data, string $path): self

Hydrates a panel failure from decoded JSON data.

Parameters

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

Returns

self: Hydrated panel failure.

public static function fromThrowable("capture"|"hydrate" $stage, Throwable $throwable): self

Captures a throwable raised during a panel lifecycle stage.

Parameters

ParameterTypeDescription
$stage"capture"|"hydrate"Lifecycle stage the panel failed in.
$throwableThrowablePanel exception to capture.

Returns

self: Captured panel failure.

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

Returns the failure record for JSON serialization.

Returns

array<string, mixed>: Serialized failure stage and exception.