symfony-notes / command-bus-bundle
Symfony Command Bus Bundle
Installs: 26
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.0.11
- sensio/framework-extra-bundle: ^3.0
- symfony/framework-bundle: ~3.0
- symfony/serializer: ^3.2
- symfony/validator: ^3.2
Requires (Dev)
- phpunit/php-code-coverage: ^4.0.4
- phpunit/phpunit: ^5.7.15
This package is auto-updated.
Last update: 2023-01-27 20:47:53 UTC
README
This bundle will help you to use Command Query Responsibility Segregation
Please see CQRS
Installation
- Require the bundle with composer:
composer require symfony-notes/command-bus-bundle
- Enable the bundle in the kernel:
public function registerBundles() { $bundles = [ // ... new SymfonyNotes\CommandBusBundle\SymfonyNotesCommandBusBundle(), // ... ]; ... }
How to use?
- Command class
class YourCommand implements CommandInterface { public $id; }
- Command Handler class
class CreateFaceHandler implements CommandHandlerInterface { public function handle(CommandInterface $command) { ... } }
- Call
command bus
$this->get('notes.command_bus')->handle($command);