Documentation

CommandBus
in package

Receives a command and sends it through a chain of middleware for processing.

Tags
final

Table of Contents

$middlewareChain  : callable
__construct()  : mixed
handle()  : mixed
Executes the given command and optionally returns a value
createExecutionChain()  : callable

Properties

$middlewareChain

private callable $middlewareChain

Methods

__construct()

public __construct(array<string|int, Middleware$middleware) : mixed
Parameters
$middleware : array<string|int, Middleware>
Return values
mixed

handle()

Executes the given command and optionally returns a value

public handle(object $command) : mixed
Parameters
$command : object
Return values
mixed

createExecutionChain()

private createExecutionChain(array<string|int, Middleware$middlewareList) : callable
Parameters
$middlewareList : array<string|int, Middleware>
Return values
callable

Search results