Skip to content
PHP Ecosystem
Explore

CurrentRouteView

API reference › Debug Core › Panel › Request › Routing › CurrentRouteView

final classPHPForge\Debug\Panel\Request\Routing\CurrentRouteView
Sourcesrc/Panel/Request/Routing/CurrentRouteView.php

Immutable current-route diagnostics for the composed Request view.

MethodDescriptionDefined by
__construct()Creates current-route diagnostics for the supplied route.CurrentRouteView
create() staticCreates 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
public function __construct(string $route = '')

Creates current-route diagnostics for the supplied route.

Parameters

ParameterTypeDescription
$routestringRoute the request resolved to, as the application declares it.
public static function create(string $route = ''): self

Creates current-route diagnostics ready for immutable enrichment.

Parameters

ParameterTypeDescription
$routestringRoute the request resolved to, as the application declares it.

Returns

self: View carrying only the resolved route.

public function getAction(): string|null

Returns the handler the request dispatched to.

Returns

string|null: Handler the request dispatched to, or null when the adapter exposes none.

public function getDefinition(): PHPForge\Debug\Panel\Request\Routing\RouteDefinition|null

Returns the route definition the request matched.

Returns

RouteDefinition|null: Matched route definition, or null when the adapter exposes none.

public function getError(): string|null

Returns the routing failure reported while resolving the request.

Returns

string|null: Routing failure message, or null when resolution succeeded.

public function getMessage(): string|null

Returns the resolution summary shown above the routing trace.

Returns

string|null: Resolution summary, or null when the adapter captured none.

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.

public function getRoute(): string

Returns the route the request resolved to.

Returns

string: Route the request resolved to, as the application declares it.

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.

public function withAction(string|null $action): self

Returns a copy carrying another dispatched handler.

Parameters

ParameterTypeDescription
$actionstring|nullHandler the request dispatched to, or null when the adapter exposes none.

Returns

self: View with the action applied.

public function withDefinition(PHPForge\Debug\Panel\Request\Routing\RouteDefinition|null $definition): self

Returns a copy carrying another route definition.

Parameters

ParameterTypeDescription
$definitionRouteDefinition|nullRoute definition the request matched, or null when unsupported.

Returns

self: View with the definition applied.

public function withError(string|null $error): self

Returns a copy carrying another routing failure.

Parameters

ParameterTypeDescription
$errorstring|nullRouting failure reported while resolving the request, or null to clear it.

Returns

self: View with the error applied.

public function withMessage(string|null $message): self

Returns a copy carrying another resolution summary.

Parameters

ParameterTypeDescription
$messagestring|nullResolution summary shown above the routing trace, or null to clear it.

Returns

self: View with the message applied.

public function withParameters(array<array-key, mixed> $parameters): self

Returns a copy carrying another set of route parameters.

Parameters

ParameterTypeDescription
$parametersarray<array-key, mixed>Parameters bound to the resolved route.

Returns

self: View with the parameters applied.

public function withTrace(list<PHPForge\Debug\Panel\Request\Routing\RouteTraceRow> $trace): self

Returns a copy carrying another routing trace.

Parameters

ParameterTypeDescription
$tracelist<RouteTraceRow>Routing rules inspected while resolving the request.

Returns

self: View with the trace applied.