Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
88.89% |
8 / 9 |
|
83.33% |
5 / 6 |
CRAP | |
0.00% |
0 / 1 |
AddressWithZipcodeCheck | |
88.89% |
8 / 9 |
|
83.33% |
5 / 6 |
6.05 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
getStreet | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getStreetNumber | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getZipcode | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getCity | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
isManualAddress | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | namespace Apie\Fixtures\ValueObjects; |
3 | |
4 | use Apie\Core\Attributes\Description; |
5 | use Apie\Core\Attributes\Internal; |
6 | use Apie\Core\ValueObjects\CompositeValueObject; |
7 | use Apie\Core\ValueObjects\DatabaseText; |
8 | use Apie\Core\ValueObjects\Interfaces\ValueObjectInterface; |
9 | |
10 | #[Description('Represents an address which can verify if the zipcode is correct with some API call')] |
11 | class AddressWithZipcodeCheck implements ValueObjectInterface |
12 | { |
13 | use CompositeValueObject; |
14 | |
15 | private DatabaseText $street; |
16 | |
17 | private DatabaseText $streetNumber; |
18 | |
19 | private DatabaseText $zipcode; |
20 | |
21 | private DatabaseText $city; |
22 | |
23 | #[Internal] |
24 | private bool $manual = true; |
25 | |
26 | public function __construct( |
27 | DatabaseText $street, |
28 | DatabaseText $streetNumber, |
29 | DatabaseText $zipcode, |
30 | DatabaseText $city |
31 | ) { |
32 | $this->street = $street; |
33 | $this->streetNumber = $streetNumber; |
34 | $this->zipcode = $zipcode; |
35 | $this->city = $city; |
36 | } |
37 | |
38 | public function getStreet(): DatabaseText |
39 | { |
40 | return $this->street; |
41 | } |
42 | |
43 | public function getStreetNumber(): DatabaseText |
44 | { |
45 | return $this->streetNumber; |
46 | } |
47 | |
48 | public function getZipcode(): DatabaseText |
49 | { |
50 | return $this->zipcode; |
51 | } |
52 | |
53 | public function getCity(): DatabaseText |
54 | { |
55 | return $this->city; |
56 | } |
57 | |
58 | public function isManualAddress(): bool |
59 | { |
60 | return $this->manual; |
61 | } |
62 | } |