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
GetIdentityHandler
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\Auth\Application\Handler;
4
5use App\Auth\Application\Command\GetIdentityQuery;
6use App\Auth\Domain\Model\Identity;
7use App\Auth\Domain\Port\Driven\IdentityRepository;
8use App\Shared\Domain\Model\EntityId;
9
10readonly 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}

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.

GetIdentityHandler->__construct
12    public function __construct(
13        private IdentityRepository $identityRepository,
14    ) {
15    }
GetIdentityHandler->__invoke
17    public function __invoke(GetIdentityQuery $query): ?Identity
18    {
19        return $this->identityRepository->findById(EntityId::fromString($query->id));
20    }
{main}
3namespace App\Auth\Application\Handler;
4
5use App\Auth\Application\Command\GetIdentityQuery;
6use App\Auth\Domain\Model\Identity;
7use App\Auth\Domain\Port\Driven\IdentityRepository;
8use App\Shared\Domain\Model\EntityId;
9
10readonly 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    }