getwarp / command-bus
Simple and extendable command bus
Fund package maintenance!
getwarp
hustlahusky
Requires
- php: ^7.4|^8.0
- getwarp/container: ^3.1
- getwarp/exception: ^3.1
- yiisoft/friendly-exception: ^1.0
Requires (Dev)
- phpunit/phpunit: ^9.5
- psr/log: ^1.1
- roave/security-advisories: dev-latest
- symfony/stopwatch: ^5.2|^6.0
Suggests
- psr/log-implementation: Required for LoggerMiddleware and ProfilerMiddleware
- symfony/stopwatch: Required for ProfilerMiddleware
README
getwarp/command-bus
Simple and extendable command bus
GitHub • Packagist • Installation • Usage
Installation
Via Composer
$ composer require getwarp/command-bus
Usage
use Warp\CommandBus\CommandBus; use Warp\CommandBus\Mapping\MapByStaticList; class MyCommand { } class MyCommandHandler { public function handle(MyCommand $command) { // Do your job to handle a command } } $commandBus = new CommandBus(new MapByStaticList([ MyCommand::class => [MyCommandHandler::class, 'handle'], ])); $commandBus->handle(new MyCommand());
Change log
Please see CHANGELOG for more information on what has changed recently.
Contributing
Report issues and send pull requests in the main Warp repository. Please see contributing guide and code of conduct for details.
Credits
License
The MIT License (MIT). Please see license file for more information.