CommandHandlerMiddleware
in package
implements
Middleware
The "core" CommandBus. Locates the appropriate handler and executes command.
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
- $commandNameExtractor : CommandNameExtractor
- $handlerLocator : HandlerLocator
- $methodNameInflector : MethodNameInflector
- __construct() : mixed
- execute() : mixed
- Executes a command and optionally returns a value
Properties
$commandNameExtractor
private
CommandNameExtractor
$commandNameExtractor
$handlerLocator
private
HandlerLocator
$handlerLocator
$methodNameInflector
private
MethodNameInflector
$methodNameInflector
Methods
__construct()
public
__construct(CommandNameExtractor $commandNameExtractor, HandlerLocator $handlerLocator, MethodNameInflector $methodNameInflector) : mixed
Parameters
- $commandNameExtractor : CommandNameExtractor
- $handlerLocator : HandlerLocator
- $methodNameInflector : MethodNameInflector
Return values
mixed —execute()
Executes a command and optionally returns a value
public
execute(object $command, callable $next) : mixed
Parameters
- $command : object
- $next : callable