RequestHandler
The web entry point over a booted {@see Kernel}: matches the request against the kernel's `milpa/http` route table and dispatches to the resolved controller, or answers 404/405 — never a legacy `Milpa\Web` request/response pair, only `psr/http-message` types, per this front's mandate to route+dispatch entirely on `milpa/http`. Building the 404/405 responses needs a concrete PSR-7 message implementation, so this class takes a PSR-17 {@see ResponseFactoryInterface} instead of hardcoding one (nyholm, guzzle, …) — the host wires whichever implementation it already depends on.
RequestHandler::__construct()
public function __construct(Milpa\Runtime\Kernel $kernel, Psr\Http\Message\ResponseFactoryInterface $responseFactory):Parameters
| Name | Type | Description |
|---|---|---|
| $kernel | Milpa\Runtime\Kernel | |
| $responseFactory | Psr\Http\Message\ResponseFactoryInterface |
RequestHandler::handle()
public function handle(Psr\Http\Message\ServerRequestInterface $request): Psr\Http\Message\ResponseInterfaceMatches `$request` against the kernel's route table and returns the controller's response, or a 404/405 built from the injected response factory.
Parameters
| Name | Type | Description |
|---|---|---|
| $request | Psr\Http\Message\ServerRequestInterface |