Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
UnionObject | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace Apie\IntegrationTests\Apie\TypeDemo\Resources; |
4 | |
5 | use Apie\Core\Entities\EntityInterface; |
6 | use Apie\CountryAndPhoneNumber\BelgianPhoneNumber; |
7 | use Apie\CountryAndPhoneNumber\DutchPhoneNumber; |
8 | use Apie\IntegrationTests\Apie\TypeDemo\Identifiers\UnionObjectId; |
9 | |
10 | class UnionObject implements EntityInterface |
11 | { |
12 | private UnionObjectId $id; |
13 | |
14 | public function __construct( |
15 | public string|int $value, |
16 | public float|bool $otherValue, |
17 | public DutchPhoneNumber|BelgianPhoneNumber|null $phoneNumber = null, |
18 | ?UnionObjectId $id = null, |
19 | ) { |
20 | $this->id = $id ?? UnionObjectId::createRandom(); |
21 | } |
22 | |
23 | public function getId(): UnionObjectId |
24 | { |
25 | return $this->id; |
26 | } |
27 | } |