-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Update readme on how to configure it, and how to use It with DI tools
With PHP/DI
return static function (ContainerBuilder $containerBuilder) {
$containerBuilder->addDefinitions(
[
'command-handlers' => [
ActivateUserHandler::class,
CreateUserHandler::class,
],
LoggerInterface::class => DI\autowire(Logger::class),
CommandBus::class => function(ContainerInterface $container) {
/** @var array<class-string<CommandHandler<Command>>> $handlers */
$handlers = $container->get('command-handlers');
return (new CommandBusBuilder($container))
->addCommandHandler(...$handlers)
->addDecorator(LoggerDecorator::class)
->build();
},
]
);
};
Metadata
Metadata
Assignees
Labels
No labels