API / Minn\Http / Envelope

Envelope interface

Minn\Http\Envelope · public/minn/src/Minn/Http/Envelope.php · 9 lines

What runs around a matched route once the router knows the route takes the request: the place a host lets other code refuse, answer or edit it (the runtime's REST server filters). The router hands over the argument check's refusal and the policy's, unthrown, because that code may clear the one and must never run the handler past the other. Without an envelope the router throws them itself.

Public

methodaround(Minn\Http\Matched $matched, Minn\Http\Request $request, ?Minn\RestError $invalid, ?Minn\RestError $refusal, Closure $invoke): Minn\Http\Response#

The answer to a matched request, refusals included.

$invokeClosure(): Responsethe route's handler; it may throw RestError