API / Minn\Http / Kernel

Kernel final readonly class

Minn\Http\Kernel · public/minn/src/Minn/Http/Kernel.php · 38 lines

The edge. Turns a request into a response through the router and turns a RestError thrown anywhere underneath into the WordPress error shape.

Used by 1

Constants and properties

privatereadonly Minn\Http\Router $router

Promoted from the constructor.

Public

new__construct(Minn\Http\Router $router)#
methodhandle(Minn\Http\Request $request): ?Minn\Http\Response#

Routes the request; a thrown failure becomes its response, and null means no route matched.

Internals 1

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privateharden(Minn\Http\Request $request, Minn\Http\Response $response): Minn\Http\Response#

Headers every response carries: no content sniffing anywhere; the sign-in and admin pages refuse framing (both headers), keep their referrer to themselves and are never cached, as the reference's do.