Skip to content
PHP Ecosystem
Explore

EventInspection

API reference › Debug Core › Panel › Event › EventInspection

final classPHPForge\Debug\Panel\Event\EventInspection
ImplementsPHPForge\Debug\Storage\PanelRow
Sourcesrc/Panel/Event/EventInspection.php

Immutable optional diagnostics; correlation identifies an observed scope, never a listener execution.

MethodDescriptionDefined by
fromArray() staticHydrates event diagnostics from decoded JSON data.EventInspection
getClock()Returns the monotonic observation time.EventInspection
getContext()Returns the selected context fields.EventInspection
getContextStatus()Returns the context capture state.EventInspection
getDepth()Returns the observed nesting depth.EventInspection
getPairId()Returns the request-local scope identity.EventInspection
getPhase()Returns the lifecycle marker.EventInspection
getTrace()Returns the captured source frames.EventInspection
getTraceStatus()Returns the trace capture state.EventInspection
jsonSerialize()Returns the diagnostics for JSON serialization.EventInspection
withContext()Returns a copy with selected context and its capture state replaced together.EventInspection
withLifecycle()Returns a copy with the complete observed lifecycle correlation replaced.EventInspection
withTrace()Returns a copy with the source trace and its capture state replaced together.EventInspection
public static function fromArray(mixed $data, string $path): self

Hydrates event diagnostics from decoded JSON data.

Parameters

ParameterTypeDescription
$datamixedDecoded event diagnostics payload.
$pathstringPayload path used in hydration errors.

Returns

self: Hydrated event diagnostics.

Throws

public function getClock(): float|null

Returns the monotonic observation time.

Returns

float|null: Observation time in seconds, or null when no clock reading was captured.

public function getContext(): array<string, string>

Returns the selected context fields.

Returns

array<string, string>: Explicit adapter-selected scalar fields.

public function getContextStatus(): string

Returns the context capture state.

Returns

string: One of disabled, captured, unsupported, or failed.

public function getDepth(): int

Returns the observed nesting depth.

Returns

int: Nesting depth of the scope the event belongs to.

public function getPairId(): int|null

Returns the request-local scope identity.

Returns

int|null: Scope identity correlating lifecycle markers, or null when none was observed.

public function getPhase(): string

Returns the lifecycle marker.

Returns

string: enter, leave, or empty for ordinary events.

public function getTrace(): list<string>

Returns the captured source frames.

Returns

list<string>: Argument-free source frames.

public function getTraceStatus(): string

Returns the trace capture state.

Returns

string: One of disabled, captured, or failed.

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

Returns the diagnostics for JSON serialization.

Returns

array<string, mixed>: Serialized context, trace, capture states, and lifecycle correlation.

public function withContext(array<string, string> $context, string $contextStatus): self

Returns a copy with selected context and its capture state replaced together.

Parameters

ParameterTypeDescription
$contextarray<string, string>Explicit adapter-selected scalar fields, not an object dump.
$contextStatusstringOne of disabled, captured, unsupported, or failed.

Returns

self: Diagnostics with the context and its capture state applied.

public function withLifecycle(int|null $pairId, string $phase, int $depth, float|null $clock): self

Returns a copy with the complete observed lifecycle correlation replaced.

Parameters

ParameterTypeDescription
$pairIdint|nullRequest-local scope identity; null means no correlation was observed.
$phasestringEmpty for ordinary events; enter or leave for lifecycle markers.
$depthintObserved nesting depth.
$clockfloat|nullMonotonic observation time in seconds, not a wall-clock timestamp.

Returns

self: Diagnostics with the lifecycle correlation applied.

public function withTrace(list<string> $trace, string $traceStatus): self

Returns a copy with the source trace and its capture state replaced together.

Parameters

ParameterTypeDescription
$tracelist<string>Argument-free source frames.
$traceStatusstringOne of disabled, captured, or failed.

Returns

self: Diagnostics with the trace and its capture state applied.