Esc
API Index — Namespaces, Packages, Reports, Indices
ApiDispatchHandler
in package
implements
RequestHandlerInterface
FinalYes
Terminal of a ZealAPI file's in-file $middleware onion. Once every in-file
middleware has called its $next, this invokes the resolved api handler
closure (ZealAPI::runHandlerWithContract) and turns the universal-return
contract result into a PSR-7 ResponseInterface for the onion:
- a
Responsepasses straight through;- a
\Generator(SSR-streaming handler) is streamed to the live response viaApp::emitGeneratorStream()and an empty placeholder is returned; null(the handler already streamed via$this->response()/$response->sse()) yields an empty placeholder.
- a
The handler closure + reflection-injected args are baked in at construction, so the onion holds no shared per-request state.
Table of Contents
Interfaces
- RequestHandlerInterface
Properties
- $api : ZealAPI
- $handler : Closure
- $invokeArgs : array<string|int, mixed>
Methods
- __construct() : mixed
- handle() : ResponseInterface
Properties
$api
private
ZealAPI
$api
$handler
private
Closure
$handler
$invokeArgs
private
array<string|int, mixed>
$invokeArgs
Methods
__construct()
public
__construct(ZealAPI $api, Closure $handler, array<int, mixed> $invokeArgs) : mixed
Parameters
- $api : ZealAPI
- $handler : Closure
- $invokeArgs : array<int, mixed>
handle()
public
handle(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface