class Psr7Middleware extends CallbackMiddleware implements Psr7InvokableInterface (View source)

The Psr7Middleware class.

Methods

getNext()

Get next middleware.

setNext(object|MiddlewareInterface $callable)

Set next middleware.

__construct(callable $handler = null, object $next = null)

Constructor.

mixed
execute(ServerRequestInterface $request = null, ResponseInterface $response = null)

Call next middleware.

callable
getHandler()

Get callback handler.

setHandler(callable $handler)

Set callback handler.

ResponseInterface
__invoke(ServerRequestInterface $request, ResponseInterface $response, callable|MiddlewareInterface $next = null)

Middleware logic to be invoked.

Details

mixed|MiddlewareInterface getNext()

Get next middleware.

Return Value

mixed|MiddlewareInterface

MiddlewareInterface setNext(object|MiddlewareInterface $callable)

Set next middleware.

Parameters

object|MiddlewareInterface $callable The middleware object.

Return Value

MiddlewareInterface Return self to support chaining.

__construct(callable $handler = null, object $next = null)

Constructor.

Parameters

callable $handler The callback handler.
object $next Next middleware.

at line line 43
mixed execute(ServerRequestInterface $request = null, ResponseInterface $response = null)

Call next middleware.

Parameters

ServerRequestInterface $request
ResponseInterface $response

Return Value

mixed

callable getHandler()

Get callback handler.

Return Value

callable The callback handler.

CallbackMiddleware setHandler(callable $handler)

Set callback handler.

Parameters

callable $handler The callback handler.

Return Value

CallbackMiddleware Return self to support chaining.

at line line 30
ResponseInterface __invoke(ServerRequestInterface $request, ResponseInterface $response, callable|MiddlewareInterface $next = null)

Middleware logic to be invoked.

Parameters

ServerRequestInterface $request The request.
ResponseInterface $response The response.
callable|MiddlewareInterface $next The next middleware.

Return Value

ResponseInterface