Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
0.00% |
0 / 2 |
n/a |
0 / 0 |
n/a |
0 / 0 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
||
| EventBus | |
0.00% |
0 / 2 |
n/a |
0 / 0 |
n/a |
0 / 0 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
||
| __construct | |
0.00% |
0 / 1 |
n/a |
0 / 0 |
n/a |
0 / 0 |
|
0.00% |
0 / 1 |
2 | |||||
| dispatch | |
0.00% |
0 / 1 |
n/a |
0 / 0 |
n/a |
0 / 0 |
|
0.00% |
0 / 1 |
2 | |||||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Message; |
| 4 | |
| 5 | use Symfony\Component\Messenger\MessageBusInterface; |
| 6 | |
| 7 | /** |
| 8 | * Global bus for events. |
| 9 | * Unused at the moment, but one use case could appear soon : a NickGeneratedEvent triggering a notification. |
| 10 | * |
| 11 | * @author Wilhelm Zwertvaegher |
| 12 | */ |
| 13 | readonly class EventBus |
| 14 | { |
| 15 | public function __construct(private MessageBusInterface $eventBus) |
| 16 | { |
| 17 | } |
| 18 | |
| 19 | public function dispatch(Command $command): void |
| 20 | { |
| 21 | $this->eventBus->dispatch($command); |
| 22 | } |
| 23 | } |