mmalessa / command-bus-bundle
Simple library to implement command-bus.
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.2
- mmalessa/command-bus: ^1.2
- symfony/framework-bundle: 4.3.*
This package is auto-updated.
Last update: 2024-05-29 04:40:57 UTC
README
Requires Symfony 4.3.*
https://github.com/mmalessa/command-bus-bundle
Use it at your own risk.
Install
composer req mmalessa/command-bus-bundle
Example of use
Register your handler(s)
services: App\Application\CommandBus\TestCommandHandler: tags: - { name: mmalessa.command_handler }
The command class is automatically detected based on the type of parameter in the handler 'handle' method.
Create command and handler
(See - README for the mmalessa/command-bus package.)
Inject command bus into Symfony command/controller
use Mmalessa/CommandBus/CommandBus public function __construct(CommandBus $commandBus) // [...]
Handle command
$command = TestCommand::create(1, 'Silifon'); $this->commandBus->handle($command);