RouterSnapshot
API reference › Debug Core › Panel › Router › RouterSnapshot
Canonical routing trace snapshot, with the URL-rule trace resolved into typed rows at capture time.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$action readonly constructor | string| | Dispatched action descriptor, or null when routing resolved none. | RouterSnapshot |
$message readonly constructor | string| | Routing trace message emitted by the URL manager, or null when it emitted none. | RouterSnapshot |
$route readonly constructor | string | Route the request resolved to. | RouterSnapshot |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a routing snapshot from the captured rule trace. | RouterSnapshot |
capture() static | Replays the URL-manager trace into typed rows, dropping the duplicate emitted by nested REST rules. | RouterSnapshot |
entries() | Returns the URL rules inspected while resolving the route. | RouterSnapshot |
fromArray() static | Narrows the persisted routing payload into a typed snapshot. | RouterSnapshot |
hasMatch() | Returns whether any inspected rule reported a successful match. | RouterSnapshot |
jsonSerialize() | Returns the panel snapshot for JSON serialization. | RouterSnapshot |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(string|null $action, string $route, string|null $message, list<PHPForge\Debug\Panel\Router\CurrentRouteLogRow> $entries)Creates a routing snapshot from the captured rule trace.
Parameters
| Parameter | Type | Description |
|---|---|---|
$action | string| | |
$route | string | |
$message | string| | |
$entries | list<CurrentRouteLogRow> |
capture()
Section titled “capture() ”public static function capture(string|null $action, array<int, array<int|string, mixed>> $messages, string $route): selfReplays the URL-manager trace into typed rows, dropping the duplicate emitted by nested REST rules.
Parameters
| Parameter | Type | Description |
|---|---|---|
$action | string| | |
$messages | array<int, | Raw routing log tuples in capture order. |
$route | string |
Returns
self
entries()
Section titled “entries() ”public function entries(): list<PHPForge\Debug\Panel\Router\CurrentRouteLogRow>Returns the URL rules inspected while resolving the route.
Returns
list<CurrentRouteLogRow>: Rules inspected during routing, in inspection order.
fromArray()
Section titled “fromArray() ”public static function fromArray(mixed $data, string $path): selfNarrows the persisted routing payload into a typed snapshot.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | Persisted payload, expected to be an object carrying the declared shape. |
$path | string | JSON path of the payload, used to report a malformed capture. |
Returns
self: Snapshot carrying the resolved route and the inspected rules.
hasMatch()
Section titled “hasMatch() ”public function hasMatch(): boolReturns whether any inspected rule reported a successful match.
Returns
bool
jsonSerialize()
Section titled “jsonSerialize() ”public function jsonSerialize(): array<string, mixed>Returns the panel snapshot for JSON serialization.
Returns
array<string, mixed>