grupocoqueiro/command-bus

Adapters for Command Bus

v1.0.1 2018-11-22 17:39 UTC

This package is auto-updated.

Last update: 2019-12-22 20:24:52 UTC


README

Adaptador para o Command Bus da Tactician

Instalação

Usando o composer: composer require grupocoqueiro/command-bus

Como utilizar

  • Crie uma classe que implemente a GrupoCoqueiro\CommandBus\MappingInterface
  • Utilize alguma classe que implemente a Psr\Container\ContainerInterface

Exemplo:

class Mapping implements MappingInterface
 {
     public function __invoke(): array
     {
         return [
            Command::class => CommandHandler::class
         ];
     }
 };
 
 $mapping = new Mapping();
 $container = new SomeImplementationContainerInterface();
 
 $commandBus = new CommandBusTacticianAdapter($mapping, $container);
 
 ...
 
 $commandBus->handle(new Command($something));