Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
8 / 8 |
|
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| UserCreatedOrchestrator | |
100.00% |
8 / 8 |
|
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 | |||
| __invoke | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\User\Application\Orchestrator; |
| 4 | |
| 5 | use App\Shared\Infrastructure\Messenger\IntegrationEventBus; |
| 6 | use App\User\Domain\Event\UserCreatedEvent; |
| 7 | use MyLegoCollection\SharedContracts\Event\UserCreatedIntegrationEvent; |
| 8 | |
| 9 | /** |
| 10 | * @author Wilhelm Zwertvaegher |
| 11 | */ |
| 12 | readonly class UserCreatedOrchestrator |
| 13 | { |
| 14 | public function __construct( |
| 15 | private IntegrationEventBus $integrationBus, |
| 16 | ) { |
| 17 | } |
| 18 | |
| 19 | public function __invoke(UserCreatedEvent $event): void |
| 20 | { |
| 21 | $this->integrationBus->dispatch( |
| 22 | new UserCreatedIntegrationEvent( |
| 23 | $event->getUser()->getId(), |
| 24 | $event->getUser()->getIdentityId(), |
| 25 | $event->metadata() |
| 26 | ) |
| 27 | ); |
| 28 | } |
| 29 | |
| 30 | } |