innmind / command-bus
This package is abandoned and no longer maintained.
No replacement package was suggested.
Command Bus library
4.2.0
2021-02-14 15:00 UTC
Requires
- php: ~7.4|~8.0
- innmind/di: ^1.0
- innmind/immutable: ~3.0
- innmind/reflection: ~4.0
- psr/log: ^1.0
- ramsey/uuid: ^3.5
Requires (Dev)
- innmind/coding-standard: ^1.1
- phpunit/phpunit: ~9.0
- vimeo/psalm: ~4.4
README
Simple library to route a command to its handler, the interface allows you to compose buses to add capabilities. Each handler must be a callable
.
Installation
composer require innmind/command-bus
Example
use function Innmind\CommandBus\bootstrap; use Innmind\Immutable\Map; class MyCommand {} $echo = function(MyCommand $command) { echo 'foo'; }; $handle = bootstrap()['bus']( Map::of('string', 'callable') (MyCommand::class, $echo) ); $handle(new MyCommand); //prints 'foo' and return null;