• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jorge07 / symfony-5-es-cqrs-boilerplate / #166

06 Feb 2026 10:12AM UTC coverage: 88.404% (+1.2%) from 87.168%
#166

push

web-flow
Merge c345ce76d into 847c843ce

36 of 45 new or added lines in 21 files covered. (80.0%)

9 existing lines in 4 files now uncovered.

587 of 664 relevant lines covered (88.4%)

8.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.62
/src/App/User/Infrastructure/Auth/AuthProvider.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace App\User\Infrastructure\Auth;
6

7
use App\User\Domain\ValueObject\Email;
8
use App\Shared\Domain\Exception\NotFoundException;
9
use App\User\Infrastructure\ReadModel\Mysql\MysqlReadModelUserRepository;
10
use Assert\AssertionFailedException;
11
use Doctrine\ORM\NonUniqueResultException;
12
use Symfony\Component\Security\Core\Exception\UserNotFoundException;
13
use Symfony\Component\Security\Core\User\UserInterface;
14
use Symfony\Component\Security\Core\User\UserProviderInterface;
15

16
/**
17
 * @implements UserProviderInterface<Auth>
18
 */
19
final class AuthProvider implements UserProviderInterface
20
{
21
    public function __construct(private readonly MysqlReadModelUserRepository $userReadModelRepository)
22
    {
23
    }
21✔
24

25
    public function loadUserByIdentifier(string $identifier): Auth
26
    {
27
        try {
28
            $credentials = $this->userReadModelRepository->getCredentialsByEmail(
10✔
29
                Email::fromString($identifier)
10✔
30
            );
10✔
31

32
            return Auth::create($credentials->uuid, $credentials->email, $credentials->password);
10✔
UNCOV
33
        } catch (NotFoundException) {
×
UNCOV
34
            throw new UserNotFoundException();
×
35
        }
36
    }
37

38
    /**
39
     * @throws NotFoundException
40
     * @throws AssertionFailedException
41
     * @throws NonUniqueResultException
42
     * @throws \Throwable
43
     */
44
    public function loadUserByUsername(string $email): Auth
45
    {
46
        $credentials = $this->userReadModelRepository->getCredentialsByEmail(
2✔
47
            Email::fromString($email)
2✔
48
        );
2✔
49

50
        return Auth::create($credentials->uuid, $credentials->email, $credentials->password);
2✔
51
    }
52

53
    /**
54
     * @throws NotFoundException
55
     * @throws AssertionFailedException
56
     * @throws NonUniqueResultException
57
     */
58
    public function refreshUser(UserInterface $user): Auth
59
    {
60
        return $this->loadUserByUsername($user->getUserIdentifier());
2✔
61
    }
62

63
    public function supportsClass(string $class): bool
64
    {
65
        return Auth::class === $class;
2✔
66
    }
67
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc