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
DoctrineIdentityAvailabilityCheckerAdapter
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
 isIdentityAvailable
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\Infrastructure\Persistence\Doctrine\Adapter;
4
5use App\Auth\Domain\Port\Driven\IdentityAvailabilityChecker;
6use App\Auth\Domain\Port\Driven\IdentityRepository;
7
8/**
9 * @author Wilhelm Zwertvaegher
10 */
11readonly class DoctrineIdentityAvailabilityCheckerAdapter implements IdentityAvailabilityChecker
12{
13    public function __construct(private IdentityRepository $identityRepository)
14    {
15    }
16
17    public function isIdentityAvailable(string $email, string $username): bool
18    {
19        return $this->identityRepository->findByEmailOrUsername($email, $username) === null;
20    }
21}

Paths

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

DoctrineIdentityAvailabilityCheckerAdapter->__construct
13    public function __construct(private IdentityRepository $identityRepository)
14    {
15    }
DoctrineIdentityAvailabilityCheckerAdapter->isIdentityAvailable
17    public function isIdentityAvailable(string $email, string $username): bool
18    {
19        return $this->identityRepository->findByEmailOrUsername($email, $username) === null;
20    }
{main}
3namespace App\Auth\Infrastructure\Persistence\Doctrine\Adapter;
4
5use App\Auth\Domain\Port\Driven\IdentityAvailabilityChecker;
6use App\Auth\Domain\Port\Driven\IdentityRepository;
7
8/**
9 * @author Wilhelm Zwertvaegher
10 */
11readonly class DoctrineIdentityAvailabilityCheckerAdapter implements IdentityAvailabilityChecker
12{
13    public function __construct(private IdentityRepository $identityRepository)
14    {
15    }
16
17    public function isIdentityAvailable(string $email, string $username): bool
18    {
19        return $this->identityRepository->findByEmailOrUsername($email, $username) === null;
20    }