Simple and extendable command bus.
Via Composer
$ composer require spaceonfire/command-bus
use spaceonfire\CommandBus\CommandBus;
use spaceonfire\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());
Please see CHANGELOG for more information on what has changed recently.
Report issues and send Pull Requests in the main spaceonfire repository. Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
The MIT License (MIT). Please see License File for more information.