class Middleware

Methods

httpErrors () : static callable

No description

authHandler (callable $tokenGenerator, Token $token = null) : static callable

No description

history (array $container) static 

No description

retry (callable $decider, callable $delay = null) static 

No description

log (LoggerInterface $logger, MessageFormatter $formatter, $logLevel = LogLevel::INFO) static 

No description

prepareBody () static 

No description

mapRequest (callable $fn) static 

No description

mapResponse (callable $fn) static 

No description

Details

static httpErrors()

Return value

callable

Example code

$callable = $middleware->httpErrors();

static authHandler(callable $tokenGenerator, Token $token = null)

Parameters

$tokenGenerator callable
$token Token

Return value

callable

Example code

$callable = $middleware->authHandler($tokenGenerator, $token);

static history(array $container)

Parameters

$container array

Example code

$middleware->history($container);

static retry(callable $decider, callable $delay = null)

Parameters

$decider callable
$delay callable

Example code

$middleware->retry($decider, $delay);

static log(LoggerInterface $logger, MessageFormatter $formatter, $logLevel = LogLevel::INFO)

Parameters

$logger LoggerInterface
$formatter MessageFormatter
$logLevel

Example code

$middleware->log($logger, $formatter, $logLevel);

static prepareBody()

Example code

$middleware->prepareBody();

static mapRequest(callable $fn)

Parameters

$fn callable

Example code

$middleware->mapRequest($fn);

static mapResponse(callable $fn)

Parameters

$fn callable

Example code

$middleware->mapResponse($fn);