CurrentRouteView
API reference › Debug Core › Panel › Request › Routing › CurrentRouteView
Immutable current-route diagnostics for the composed Request view.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates current-route diagnostics for the supplied route. | CurrentRouteView |
create() static | Creates current-route diagnostics ready for immutable enrichment. | CurrentRouteView |
getAction() | Returns the handler the request dispatched to. | CurrentRouteView |
getDefinition() | Returns the route definition the request matched. | CurrentRouteView |
getError() | Returns the routing failure reported while resolving the request. | CurrentRouteView |
getMessage() | Returns the resolution summary shown above the routing trace. | CurrentRouteView |
getParameters() | Returns the parameters bound to the resolved route. | CurrentRouteView |
getRoute() | Returns the route the request resolved to. | CurrentRouteView |
getTrace() | Returns the routing rules inspected while resolving the request. | CurrentRouteView |
withAction() | Returns a copy carrying another dispatched handler. | CurrentRouteView |
withDefinition() | Returns a copy carrying another route definition. | CurrentRouteView |
withError() | Returns a copy carrying another routing failure. | CurrentRouteView |
withMessage() | Returns a copy carrying another resolution summary. | CurrentRouteView |
withParameters() | Returns a copy carrying another set of route parameters. | CurrentRouteView |
withTrace() | Returns a copy carrying another routing trace. | CurrentRouteView |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(string $route = '')Creates current-route diagnostics for the supplied route.
Parameters
| Parameter | Type | Description |
|---|---|---|
$route | string | Route the request resolved to, as the application declares it. |
create()
Section titled “create() ”public static function create(string $route = ''): selfCreates current-route diagnostics ready for immutable enrichment.
Parameters
| Parameter | Type | Description |
|---|---|---|
$route | string | Route the request resolved to, as the application declares it. |
Returns
self: View carrying only the resolved route.
getAction()
Section titled “getAction() ”public function getAction(): string|nullReturns the handler the request dispatched to.
Returns
string|null: Handler the request dispatched to, or null when the adapter exposes none.
getDefinition()
Section titled “getDefinition() ”public function getDefinition(): PHPForge\Debug\Panel\Request\Routing\RouteDefinition|nullReturns the route definition the request matched.
Returns
RouteDefinition|null: Matched route definition, or null when the adapter exposes none.
getError()
Section titled “getError() ”public function getError(): string|nullReturns the routing failure reported while resolving the request.
Returns
string|null: Routing failure message, or null when resolution succeeded.
getMessage()
Section titled “getMessage() ”public function getMessage(): string|nullReturns the resolution summary shown above the routing trace.
Returns
string|null: Resolution summary, or null when the adapter captured none.
getParameters()
Section titled “getParameters() ”public function getParameters(): array<array-key, mixed>Returns the parameters bound to the resolved route.
Returns
array<array-key, mixed>: Parameters bound to the resolved route.
getRoute()
Section titled “getRoute() ”public function getRoute(): stringReturns the route the request resolved to.
Returns
string: Route the request resolved to, as the application declares it.
getTrace()
Section titled “getTrace() ”public function getTrace(): list<PHPForge\Debug\Panel\Request\Routing\RouteTraceRow>Returns the routing rules inspected while resolving the request.
Returns
list<RouteTraceRow>: Routing rules inspected while resolving the request.
withAction()
Section titled “withAction() ”public function withAction(string|null $action): selfReturns a copy carrying another dispatched handler.
Parameters
| Parameter | Type | Description |
|---|---|---|
$action | string| | Handler the request dispatched to, or null when the adapter exposes none. |
Returns
self: View with the action applied.
withDefinition()
Section titled “withDefinition() ”public function withDefinition(PHPForge\Debug\Panel\Request\Routing\RouteDefinition|null $definition): selfReturns a copy carrying another route definition.
Parameters
| Parameter | Type | Description |
|---|---|---|
$definition | RouteDefinition| | Route definition the request matched, or null when unsupported. |
Returns
self: View with the definition applied.
withError()
Section titled “withError() ”public function withError(string|null $error): selfReturns a copy carrying another routing failure.
Parameters
| Parameter | Type | Description |
|---|---|---|
$error | string| | Routing failure reported while resolving the request, or null to clear it. |
Returns
self: View with the error applied.
withMessage()
Section titled “withMessage() ”public function withMessage(string|null $message): selfReturns a copy carrying another resolution summary.
Parameters
| Parameter | Type | Description |
|---|---|---|
$message | string| | Resolution summary shown above the routing trace, or null to clear it. |
Returns
self: View with the message applied.
withParameters()
Section titled “withParameters() ”public function withParameters(array<array-key, mixed> $parameters): selfReturns a copy carrying another set of route parameters.
Parameters
| Parameter | Type | Description |
|---|---|---|
$parameters | array<array-key, | Parameters bound to the resolved route. |
Returns
self: View with the parameters applied.
withTrace()
Section titled “withTrace() ”public function withTrace(list<PHPForge\Debug\Panel\Request\Routing\RouteTraceRow> $trace): selfReturns a copy carrying another routing trace.
Parameters
| Parameter | Type | Description |
|---|---|---|
$trace | list<RouteTraceRow> | Routing rules inspected while resolving the request. |
Returns
self: View with the trace applied.