Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| CommandBus | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| dispatch | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Shared\Infrastructure\Messenger; |
| 4 | |
| 5 | use MyLegoCollection\SharedContracts\Command\Command; |
| 6 | use MyLegoCollection\SharedContracts\Event\IntegrationEvent; |
| 7 | use Symfony\Component\Messenger\MessageBusInterface; |
| 8 | |
| 9 | /** |
| 10 | * Global bus for shared integration (i.e. cross-slices events) |
| 11 | * @author Wilhelm Zwertvaegher |
| 12 | */ |
| 13 | readonly class CommandBus |
| 14 | { |
| 15 | |
| 16 | public function __construct(private MessageBusInterface $commandBus) |
| 17 | { |
| 18 | } |
| 19 | |
| 20 | public function dispatch(Command $command): void |
| 21 | { |
| 22 | $this->commandBus->dispatch($command); |
| 23 | } |
| 24 | } |