class MiddlewaresChain implements MiddlewareInterface, RequestHandlerInterface (View source)

Properties

protected MiddlewareInterface[] $chain
protected string $name

Methods

__construct(string $name = 'default', array $middlewaresChain = [])

No description

append(MiddlewareInterface $middleware)

No description

prepend(MiddlewareInterface $middleware)

No description

ResponseInterface
process(ServerRequestInterface $request, RequestHandlerInterface $handler)

The PSR-15 middleware implementation method

ResponseInterface
handle(ServerRequestInterface $request)

The PSR-15 request handler implementation method

Details

__construct(string $name = 'default', array $middlewaresChain = [])

No description

Parameters

string $name
array $middlewaresChain

append(MiddlewareInterface $middleware)

No description

Parameters

MiddlewareInterface $middleware

prepend(MiddlewareInterface $middleware)

No description

Parameters

MiddlewareInterface $middleware

ResponseInterface process(ServerRequestInterface $request, RequestHandlerInterface $handler)

The PSR-15 middleware implementation method

Parameters

ServerRequestInterface $request
RequestHandlerInterface $handler

Return Value

ResponseInterface

ResponseInterface handle(ServerRequestInterface $request)

The PSR-15 request handler implementation method

Parameters

ServerRequestInterface $request

Return Value

ResponseInterface