Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| GetIdentityHandler | |
100.00% |
2 / 2 |
|
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% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Auth\Application\Handler; |
| 4 | |
| 5 | use App\Auth\Application\Command\GetIdentityQuery; |
| 6 | use App\Auth\Domain\Model\Identity; |
| 7 | use App\Auth\Domain\Port\Driven\IdentityRepository; |
| 8 | use App\Shared\Domain\Model\EntityId; |
| 9 | |
| 10 | readonly class GetIdentityHandler |
| 11 | { |
| 12 | public function __construct( |
| 13 | private IdentityRepository $identityRepository, |
| 14 | ) { |
| 15 | } |
| 16 | |
| 17 | public function __invoke(GetIdentityQuery $query): ?Identity |
| 18 | { |
| 19 | return $this->identityRepository->findById(EntityId::fromString($query->id)); |
| 20 | } |
| 21 | } |