Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
5 / 5
CRAP
100.00% covered (success)
100.00%
1 / 1
AuthenticatedUser
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
5 / 5
5
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
 getUserIdentifier
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
 getRoles
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
 getPassword
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
 eraseCredentials
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\Security\User;
4
5use App\Auth\Domain\Model\Identity;
6use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
7use Symfony\Component\Security\Core\User\UserInterface;
8
9readonly class AuthenticatedUser implements UserInterface, PasswordAuthenticatedUserInterface
10{
11    public function __construct(private Identity $identity)
12    {
13    }
14
15    public function getUserIdentifier(): string
16    {
17        return $this->identity->getId()->value();
18    }
19
20    public function getRoles(): array
21    {
22        return $this->identity->getRoles();
23    }
24
25    public function getPassword(): ?string
26    {
27        return $this->identity->getPasswordHash();
28    }
29
30    #[\Deprecated]
31    public function eraseCredentials(): void
32    {
33    }
34}

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.

AuthenticatedUser->__construct
11    public function __construct(private Identity $identity)
12    {
13    }
AuthenticatedUser->eraseCredentials
33    }
AuthenticatedUser->getPassword
27        return $this->identity->getPasswordHash();
28    }
AuthenticatedUser->getRoles
22        return $this->identity->getRoles();
23    }
AuthenticatedUser->getUserIdentifier
17        return $this->identity->getId()->value();
18    }
{main}
3namespace App\Auth\Infrastructure\Security\User;
4
5use App\Auth\Domain\Model\Identity;
6use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
7use Symfony\Component\Security\Core\User\UserInterface;
8
9readonly class AuthenticatedUser implements UserInterface, PasswordAuthenticatedUserInterface
10{
11    public function __construct(private Identity $identity)
12    {
13    }
14
15    public function getUserIdentifier(): string
16    {
17        return $this->identity->getId()->value();
18    }
19
20    public function getRoles(): array
21    {
22        return $this->identity->getRoles();
23    }
24
25    public function getPassword(): ?string
26    {
27        return $this->identity->getPasswordHash();
28    }
29
30    #[\Deprecated]
31    public function eraseCredentials(): void
32    {
33    }