CallableRequestHandler
Adapts a controller instance plus a method name — the two halves of `milpa/http`'s `HandlerReference` — into a live PSR-15 {@see RequestHandlerInterface}. The controller method is called with the (route-result-decorated) request and MUST return a {@see ResponseInterface}; anything else is a controller-authoring bug, surfaced loudly rather than coerced.
CallableRequestHandler::__construct()
public function __construct(object $controller, string $method):Parameters
| Name | Type | Description |
|---|---|---|
| $controller | object | |
| $method | string |
CallableRequestHandler::handle()
public function handle(Psr\Http\Message\ServerRequestInterface $request): Psr\Http\Message\ResponseInterfaceInvokes the wrapped controller method and returns its response.
Parameters
| Name | Type | Description |
|---|---|---|
| $request | Psr\Http\Message\ServerRequestInterface |