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 |
| DoctrineIdentityAvailabilityCheckerAdapter | |
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 | |||
| isIdentityAvailable | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Auth\Infrastructure\Persistence\Doctrine\Adapter; |
| 4 | |
| 5 | use App\Auth\Domain\Port\Driven\IdentityAvailabilityChecker; |
| 6 | use App\Auth\Domain\Port\Driven\IdentityRepository; |
| 7 | |
| 8 | /** |
| 9 | * @author Wilhelm Zwertvaegher |
| 10 | */ |
| 11 | readonly 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 | } |