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