PHP code example of stratadox / command-handling
1. Go to this page and download the library: Download stratadox/command-handling library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
stratadox / command-handling example snippets
use Stratadox\CommandHandling\CommandBus;
$bus = CommandBus::handling([
SomeCommand::class => new SomeHandler(),
OtherCommand::class => new OtherHandler(),
]);
$bus->handle(new SomeCommand('foo'));