2017 © Pedro Peláez
 

library aura-di-tactician

A simple aura/di container config for league/tactician

image

seahorse/aura-di-tactician

A simple aura/di container config for league/tactician

  • Tuesday, July 25, 2017
  • by glassrobot
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Aura Di ContainerBuiler config for Tactician

A simple aura/di container config for league/tactician., (*1)

Add Seahorse\Tactician\Config to your ContainerBuilder., (*2)

League\Tactician\CommandBus has the service name league:tactician/commandbus, (*3)

Mapping commands to handlers

In your ContainerBuilder configuration class you need to map commands to handlers., (*4)

$di->set('service-name', $di->lazyNew('Your\Handler'));

$di->values['commandsToHandlersMap'] = [
    YourCommand::CLASS => 'service-name',
];

Adding middleware

Override the middleware params in your ContainerBuilder configuration class., (*5)

$di->params['League\Tactician\CommandBus']['middleware'] = $di->lazyArray([
        // add your middleware, order is important
        $di->lazyNew('League\Tactician\Plugins\LockingMiddleware'),
        $di->lazyNew('League\Tactician\Handler\CommandHandlerMiddleware'),
    ]
);

The Versions

25/07 2017

dev-master

9999999-dev

A simple aura/di container config for league/tactician

  Sources   Download

MIT

The Requires