Skip to content

Add documentation #33

@jeckel

Description

@jeckel

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions