Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| UserCreatedIntegrationEventHandler | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getMessageHandled | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| __invoke | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Auth\Infrastructure\EventHandler; |
| 4 | |
| 5 | use App\Auth\Application\Handler\UserCreatedHandler; |
| 6 | use App\Auth\Application\Orchestrator\IdentityCreatedOrchestrator; |
| 7 | use App\Shared\Infrastructure\EventHandler\IntegrationEventHandler; |
| 8 | use App\Shared\Infrastructure\EventHandler\MessageHandler; |
| 9 | use MyLegoCollection\SharedContracts\Event\UserCreatedIntegrationEvent; |
| 10 | use Symfony\Component\Messenger\Attribute\AsMessageHandler; |
| 11 | |
| 12 | /** |
| 13 | * @implements IntegrationEventHandler<UserCreatedIntegrationEvent> |
| 14 | * @author Wilhelm Zwertvaegher |
| 15 | */ |
| 16 | #[AsMessageHandler] |
| 17 | readonly class UserCreatedIntegrationEventHandler implements IntegrationEventHandler |
| 18 | { |
| 19 | public function __construct(private UserCreatedHandler $userCreatedHandler) |
| 20 | { |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * @return class-string<UserCreatedIntegrationEvent> |
| 25 | */ |
| 26 | public static function getMessageHandled(): string |
| 27 | { |
| 28 | return UserCreatedIntegrationEvent::class; |
| 29 | } |
| 30 | |
| 31 | public function __invoke(UserCreatedIntegrationEvent $event): void |
| 32 | { |
| 33 | ($this->userCreatedHandler)($event); |
| 34 | } |
| 35 | } |