Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
5 / 5 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
| UserWithAutoincrementKey | |
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 | |||
| getAddress | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setPassword | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getPassword | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\Fixtures\Entities; |
| 3 | |
| 4 | use Apie\Core\Attributes\FakeCount; |
| 5 | use Apie\Core\Attributes\SearchFilterOption; |
| 6 | use Apie\Core\Entities\EntityInterface; |
| 7 | use Apie\Fixtures\Identifiers\UserAutoincrementIdentifier; |
| 8 | use Apie\Fixtures\ValueObjects\AddressWithZipcodeCheck; |
| 9 | use Apie\Fixtures\ValueObjects\Password; |
| 10 | |
| 11 | #[FakeCount(100)] |
| 12 | class UserWithAutoincrementKey implements EntityInterface |
| 13 | { |
| 14 | private UserAutoincrementIdentifier $id; |
| 15 | |
| 16 | private ?Password $password = null; |
| 17 | |
| 18 | public function __construct(private AddressWithZipcodeCheck $address) |
| 19 | { |
| 20 | $this->id = UserAutoincrementIdentifier::fromNative(null); |
| 21 | } |
| 22 | |
| 23 | public function getId(): UserAutoincrementIdentifier |
| 24 | { |
| 25 | return $this->id; |
| 26 | } |
| 27 | |
| 28 | public function getAddress(): AddressWithZipcodeCheck |
| 29 | { |
| 30 | return $this->address; |
| 31 | } |
| 32 | |
| 33 | public function setPassword(Password $password) |
| 34 | { |
| 35 | $this->password = $password; |
| 36 | } |
| 37 | |
| 38 | #[SearchFilterOption(enabled: false)] |
| 39 | public function getPassword(): ?Password |
| 40 | { |
| 41 | return $this->password; |
| 42 | } |
| 43 | } |