class MiddlewareHandler implements RequestHandlerInterface (View source)

A middleware stack that acts like a request handler.

Methods

__construct(RequestHandlerInterface $fallback)

MiddlewareHandler constructor.

void
push(MiddlewareInterface $middleware)

Adds a new middleware to the stack.

ResponseInterface
handle(ServerRequestInterface $request)

{@inheritdoc}

Details

__construct(RequestHandlerInterface $fallback)

MiddlewareHandler constructor.

Parameters

RequestHandlerInterface $fallback The fallback request handler to call

void push(MiddlewareInterface $middleware)

Adds a new middleware to the stack.

Parameters

MiddlewareInterface $middleware Additional middleware to add to the stack

Return Value

void

ResponseInterface handle(ServerRequestInterface $request)

{@inheritdoc}

Parameters

ServerRequestInterface $request

Return Value

ResponseInterface