LoggerMiddleware
in package
implements
Middleware
Add support for writing a message to the log whenever a command is received, handled or failed.
Interfaces, Classes and Traits
- Middleware
- Middleware are the plugins of Tactician. They receive each command that's given to the CommandBus and can take any action they choose. Middleware can continue the Command processing by passing the command they receive to the $next callable, which is essentially the "next" Middleware in the chain.
Table of Contents
- $formatter : Formatter
- $logger : LoggerInterface
- __construct() : mixed
- execute() : mixed
Properties
$formatter
private
Formatter
$formatter
$logger
private
LoggerInterface
$logger
Methods
__construct()
public
__construct(Formatter $formatter, LoggerInterface $logger) : mixed
Parameters
- $formatter : Formatter
- $logger : LoggerInterface
Return values
mixed —execute()
public
execute(mixed $command, callable $next) : mixed
Parameters
- $command : mixed
- $next : callable