Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
| AuthenticatedUser | |
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
5 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getUserIdentifier | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getRoles | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getPassword | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| eraseCredentials | |
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\Security\User; |
| 4 | |
| 5 | use App\Auth\Domain\Model\Identity; |
| 6 | use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; |
| 7 | use Symfony\Component\Security\Core\User\UserInterface; |
| 8 | |
| 9 | readonly 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 | } |