Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| DoctrineEmailAvailabilityCheckerAdapter | |
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
2.50 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| isEmailAvailable | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Auth\Infrastructure\Persistence\Doctrine\Adapter; |
| 4 | |
| 5 | use App\Auth\Domain\Port\Driven\EmailAvailabilityChecker; |
| 6 | use App\Auth\Domain\Port\Driven\IdentityRepository; |
| 7 | |
| 8 | /** |
| 9 | * @author Wilhelm Zwertvaegher |
| 10 | */ |
| 11 | readonly class DoctrineEmailAvailabilityCheckerAdapter implements EmailAvailabilityChecker |
| 12 | { |
| 13 | public function __construct(private IdentityRepository $identityRepository) |
| 14 | { |
| 15 | } |
| 16 | |
| 17 | public function isEmailAvailable(string $email): bool |
| 18 | { |
| 19 | return $this->identityRepository->findByEmail($email) === null; |
| 20 | } |
| 21 | } |