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\Message; |
| 4 | |
| 5 | use Symfony\Component\Messenger\MessageBusInterface; |
| 6 | |
| 7 | /** |
| 8 | * Global bus for commands. |
| 9 | * |
| 10 | * @author Wilhelm Zwertvaegher |
| 11 | */ |
| 12 | readonly class CommandBus |
| 13 | { |
| 14 | public function __construct(private MessageBusInterface $commandBus) |
| 15 | { |
| 16 | } |
| 17 | |
| 18 | public function dispatch(Command $command): void |
| 19 | { |
| 20 | $this->commandBus->dispatch($command); |
| 21 | } |
| 22 | } |