final class DispatchRequestHandler implements RequestHandlerInterface (View source)

Reuses a trusted pre-match or matches the request, publishes its RouteMatch, and delegates to route middleware.

It honors a dispatch-only path attribute while keeping the original request URI available to the selected controller and its middleware.

Methods

__construct(Router $router, ControllerResolver $resolver, MiddlewareResolver $middlewareResolver, HttpInstrumentation|null $diagnostics = null, ScopedContainerInterface|null $scope = null)

Initializes the routing dispatch boundary for one application runtime.

ResponseInterface
handle(ServerRequestInterface $request)

Dispatches the canonical match while binding the matched request in its scope.

ResponseInterface

Details

__construct

__construct(Router $router, ControllerResolver $resolver, MiddlewareResolver $middlewareResolver, HttpInstrumentation|null $diagnostics = null, ScopedContainerInterface|null $scope = null)

Initializes the routing dispatch boundary for one application runtime.

Parameters

Router $router
ControllerResolver $resolver
MiddlewareResolver $middlewareResolver
HttpInstrumentation|null $diagnostics
ScopedContainerInterface|null $scope

handle

ResponseInterface handle(ServerRequestInterface $request)

Dispatches the canonical match while binding the matched request in its scope.

Parameters

ServerRequestInterface $request

Return Value

ResponseInterface