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