Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
GetUserHandler
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
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
 __invoke
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
1<?php
2
3namespace App\User\Application\Handler;
4
5use App\Auth\Domain\Model\Identity;
6use App\Auth\Domain\Service\IdentityService;
7use App\Shared\Domain\Model\EntityId;
8use App\User\Application\Command\GetUserByIdentityQuery;
9use App\User\Domain\Model\User;
10use App\User\Domain\Port\Driven\UserRepository;
11use App\User\Domain\Service\UserService;
12
13readonly class GetUserHandler
14{
15    public function __construct(
16        private UserRepository $userRepository
17    ) {
18    }
19
20    public function __invoke(GetUserByIdentityQuery $query): ?User
21    {
22        return $this->userRepository->findByIdentityId(EntityId::fromString($query->identityId));
23    }
24}