EventInspection
API reference › Debug Core › Panel › Event › EventInspection
Immutable optional diagnostics; correlation identifies an observed scope, never a listener execution.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
fromArray() static | Hydrates 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 |
Method details
Section titled “Method details”fromArray()
Section titled “fromArray() ”public static function fromArray(mixed $data, string $path): selfHydrates event diagnostics from decoded JSON data.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | Decoded event diagnostics payload. |
$path | string | Payload path used in hydration errors. |
Returns
self: Hydrated event diagnostics.
Throws
PHPForge\Debug\Storage\HydrationException: When a value exceeds its bound or a capture state is unknown.
getClock()
Section titled “getClock() ”public function getClock(): float|nullReturns the monotonic observation time.
Returns
float|null: Observation time in seconds, or null when no clock reading was captured.
getContext()
Section titled “getContext() ”public function getContext(): array<string, string>Returns the selected context fields.
Returns
array<string, string>: Explicit adapter-selected scalar fields.
getContextStatus()
Section titled “getContextStatus() ”public function getContextStatus(): stringReturns the context capture state.
Returns
string: One of disabled, captured, unsupported, or failed.
getDepth()
Section titled “getDepth() ”public function getDepth(): intReturns the observed nesting depth.
Returns
int: Nesting depth of the scope the event belongs to.
getPairId()
Section titled “getPairId() ”public function getPairId(): int|nullReturns the request-local scope identity.
Returns
int|null: Scope identity correlating lifecycle markers, or null when none was observed.
getPhase()
Section titled “getPhase() ”public function getPhase(): stringReturns the lifecycle marker.
Returns
string: enter, leave, or empty for ordinary events.
getTrace()
Section titled “getTrace() ”public function getTrace(): list<string>Returns the captured source frames.
Returns
list<string>: Argument-free source frames.
getTraceStatus()
Section titled “getTraceStatus() ”public function getTraceStatus(): stringReturns the trace capture state.
Returns
string: One of disabled, captured, or failed.
jsonSerialize()
Section titled “jsonSerialize() ”public function jsonSerialize(): array<string, mixed>Returns the diagnostics for JSON serialization.
Returns
array<string, mixed>: Serialized context, trace, capture states, and lifecycle correlation.
withContext()
Section titled “withContext() ”public function withContext(array<string, string> $context, string $contextStatus): selfReturns a copy with selected context and its capture state replaced together.
Parameters
| Parameter | Type | Description |
|---|---|---|
$context | array<string, | Explicit adapter-selected scalar fields, not an object dump. |
$contextStatus | string | One of disabled, captured, unsupported, or failed. |
Returns
self: Diagnostics with the context and its capture state applied.
withLifecycle()
Section titled “withLifecycle() ”public function withLifecycle(int|null $pairId, string $phase, int $depth, float|null $clock): selfReturns a copy with the complete observed lifecycle correlation replaced.
Parameters
| Parameter | Type | Description |
|---|---|---|
$pairId | int| | Request-local scope identity; null means no correlation was observed. |
$phase | string | Empty for ordinary events; enter or leave for lifecycle markers. |
$depth | int | Observed nesting depth. |
$clock | float| | Monotonic observation time in seconds, not a wall-clock timestamp. |
Returns
self: Diagnostics with the lifecycle correlation applied.
withTrace()
Section titled “withTrace() ”public function withTrace(list<string> $trace, string $traceStatus): selfReturns a copy with the source trace and its capture state replaced together.
Parameters
| Parameter | Type | Description |
|---|---|---|
$trace | list<string> | Argument-free source frames. |
$traceStatus | string | One of disabled, captured, or failed. |
Returns
self: Diagnostics with the trace and its capture state applied.