final class MiddlewaresChain implements RequestHandlerInterface (View source)

Methods

__construct(array $middlewaresChain)

No description

void
onStep(Closure $callback)

Register a callback that is invoked whenever a middleware component is about to be processed

ResponseInterface
handle(ServerRequestInterface $request)

The PSR-15 request handler implementation method

Details

__construct(array $middlewaresChain)

No description

Parameters

array $middlewaresChain

void onStep(Closure $callback)

Register a callback that is invoked whenever a middleware component is about to be processed

Usage:

$middlewaresChain->onStep(function(ServerRequestInterface $request) { // $request contains the latest instance of the server request });

Parameters

Closure $callback

Return Value

void

ResponseInterface handle(ServerRequestInterface $request)

The PSR-15 request handler implementation method

Parameters

ServerRequestInterface $request

Return Value

ResponseInterface