Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
| User | |
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
5 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getEmail | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getHashedPassword | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getGroup | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | // ╔════════════════════════════════════════════════════════════╗ |
| 4 | // ║ MIT Licence (#Expat) - https://opensource.org/licenses/MIT ║ |
| 5 | // ║ Copyright 2026 Frederic Poeydomenge <dyno@phexium.com> ║ |
| 6 | // ╚════════════════════════════════════════════════════════════╝ |
| 7 | |
| 8 | declare(strict_types=1); |
| 9 | |
| 10 | namespace AppDemo\User\Domain; |
| 11 | |
| 12 | use Phexium\Domain\EntityAbstract; |
| 13 | use Phexium\Domain\EntityInterface; |
| 14 | use Phexium\Domain\Id\IdInterface; |
| 15 | |
| 16 | class User extends EntityAbstract implements EntityInterface |
| 17 | { |
| 18 | public function __construct( |
| 19 | private readonly IdInterface $id, |
| 20 | private readonly Email $email, |
| 21 | private readonly HashedPassword $hashedPassword, |
| 22 | private readonly UserGroup $group, |
| 23 | ) {} |
| 24 | |
| 25 | public function getId(): IdInterface |
| 26 | { |
| 27 | return $this->id; |
| 28 | } |
| 29 | |
| 30 | public function getEmail(): Email |
| 31 | { |
| 32 | return $this->email; |
| 33 | } |
| 34 | |
| 35 | public function getHashedPassword(): HashedPassword |
| 36 | { |
| 37 | return $this->hashedPassword; |
| 38 | } |
| 39 | |
| 40 | public function getGroup(): UserGroup |
| 41 | { |
| 42 | return $this->group; |
| 43 | } |
| 44 | } |