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
DoctrineRetrieveUserForIdentityAdapter
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
 retrieveUser
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\Infrastructure\Persistence\Doctrine\Adapter;
4
5use App\Shared\Domain\Model\EntityId;
6use App\User\Domain\Model\User;
7use App\User\Domain\Port\Driven\RetrieveUserForIdentity;
8use App\User\Domain\Port\Driven\UserRepository;
9
10/**
11 * @author Wilhelm Zwertvaegher
12 */
13readonly class DoctrineRetrieveUserForIdentityAdapter implements RetrieveUserForIdentity
14{
15
16    public function __construct(private UserRepository $userRepository)
17    {
18    }
19
20    public function retrieveUser(EntityId $identityId): ?User
21    {
22        return $this->userRepository->findByIdentityId($identityId);
23    }
24}

Branches

Below are the source code lines that represent each code branch as identified by Xdebug. Please note a branch is not necessarily coterminous with a line, a line may contain multiple branches and therefore show up more than once. Please also be aware that some branches may be implicit rather than explicit, e.g. an if statement always has an else as part of its logical flow even if you didn't write one.

DoctrineRetrieveUserForIdentityAdapter->__construct
16    public function __construct(private UserRepository $userRepository)
17    {
18    }
DoctrineRetrieveUserForIdentityAdapter->retrieveUser
20    public function retrieveUser(EntityId $identityId): ?User
21    {
22        return $this->userRepository->findByIdentityId($identityId);
23    }
{main}
3namespace App\User\Infrastructure\Persistence\Doctrine\Adapter;
4
5use App\Shared\Domain\Model\EntityId;
6use App\User\Domain\Model\User;
7use App\User\Domain\Port\Driven\RetrieveUserForIdentity;
8use App\User\Domain\Port\Driven\UserRepository;
9
10/**
11 * @author Wilhelm Zwertvaegher
12 */
13readonly class DoctrineRetrieveUserForIdentityAdapter implements RetrieveUserForIdentity
14{
15
16    public function __construct(private UserRepository $userRepository)
17    {
18    }
19
20    public function retrieveUser(EntityId $identityId): ?User
21    {
22        return $this->userRepository->findByIdentityId($identityId);
23    }