trait HTTPMiddlewareAware (View source)

Adds middleware support to an object.

Provides a Middlewares property and a callMiddleware() callback

Properties

protected HTTPMiddleware[] $middlewares

Methods

public
getMiddlewares()

No description

public
$this
setMiddlewares(HTTPMiddleware[] $middlewares)

No description

public
$this
addMiddleware(HTTPMiddleware $middleware)

No description

protected
callMiddleware(HTTPRequest $request, callable $last)

Call middleware

Details

HTTPMiddleware[] getMiddlewares()

No description

Return Value

HTTPMiddleware[]

$this setMiddlewares(HTTPMiddleware[] $middlewares)

No description

Parameters

HTTPMiddleware[] $middlewares

Return Value

$this

$this addMiddleware(HTTPMiddleware $middleware)

No description

Parameters

HTTPMiddleware $middleware

Return Value

$this

protected HTTPResponse callMiddleware(HTTPRequest $request, callable $last)

Call middleware

Parameters

HTTPRequest $request

The request to pass to the middlewares and callback

callable $last

The callback to call after all middlewares

Return Value

HTTPResponse