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 |
| GetUserHandler | |
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\User\Application\Handler; |
| 4 | |
| 5 | use App\Auth\Domain\Model\Identity; |
| 6 | use App\Auth\Domain\Service\IdentityService; |
| 7 | use App\Shared\Domain\Model\EntityId; |
| 8 | use App\User\Application\Command\GetUserByIdentityQuery; |
| 9 | use App\User\Domain\Model\User; |
| 10 | use App\User\Domain\Port\Driven\UserRepository; |
| 11 | use App\User\Domain\Service\UserService; |
| 12 | |
| 13 | readonly 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 | } |