CommandBus
class CommandBus implements CommandBusInterface
Command bus.
Constants
COMMAND_SUFFIX |
Command suffix. |
HANDLER_SUFFIX |
Handler suffix. |
Properties
protected Container | $container | Container. | |
protected Onion | $onion | Onion. |
Methods
int
addMiddleware(string $middleware, bool $inner = true)
Adds middleware.
mixed
executeCommandHandler(CommandHandlerInterface $handler, CommandInterface $command)
Executes the command handler.
mixed
resolveOnion(array $middleware)
Resolves the onion instance.
mixed
dispatch(CommandInterface|string $command, array $parameters = [], array $middleware = [])
Dispatches the command to the command handler and returns the result.
Details
at line 71
int
addMiddleware(string $middleware, bool $inner = true)
Adds middleware.
at line 83
protected CommandInterface
resolveCommand(CommandInterface|string $command, array $parameters)
Resolves the command.
at line 99
protected CommandHandlerInterface
resolveCommandHandler(CommandInterface $command)
Resolves the command handler.
at line 128
protected mixed
executeCommandHandler(CommandHandlerInterface $handler, CommandInterface $command)
Executes the command handler.
at line 139
protected mixed
handle(CommandInterface $command)
Handles the command.
at line 157
protected Onion
resolveOnion(array $middleware)
Resolves the onion instance.
at line 177
mixed
dispatch(CommandInterface|string $command, array $parameters = [], array $middleware = [])
Dispatches the command to the command handler and returns the result.