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 69
int
addMiddleware(string $middleware, bool $inner = true)
Adds middleware.
at line 81
protected CommandInterface
resolveCommand(CommandInterface|string $command, array $parameters)
Resolves the command.
at line 97
protected CommandHandlerInterface
resolveCommandHandler(CommandInterface $command)
Resolves the command handler.
at line 126
protected mixed
executeCommandHandler(CommandHandlerInterface $handler, CommandInterface $command)
Executes the command handler.
at line 137
protected mixed
handle(CommandInterface $command)
Handles the command.
at line 155
protected Onion
resolveOnion(array $middleware)
Resolves the onion instance.
at line 175
mixed
dispatch(CommandInterface|string $command, array $parameters = [], array $middleware = [])
Dispatches the command to the command handler and returns the result.