Passed
Branch fuzzy-generators (49fcec)
by SignpostMarv
08:30
created

PostalAddress::GetStreetAddress()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 12
ccs 6
cts 6
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
* @author SignpostMarv
4
*/
5
declare(strict_types=1);
6
7
namespace SignpostMarv\DaftObject\SchemaOrg\Intangible\StructuredValue\ContactPoint;
8
9
use SignpostMarv\DaftObject\SchemaOrg\DaftObjectTraits;
10
use SignpostMarv\DaftObject\SchemaOrg\Intangible\StructuredValue\ContactPoint as Base;
11
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
12
13
class PostalAddress extends Base
14
{
15
    use DaftObjectTraits\HasAddressCountry;
16
    use DaftObjectTraits\HasPostalCode;
17
18
    const SCHEMA_ORG_TYPE = 'PostalAddress';
19
20
    const PROPERTIES = [
21
        'addressCountry',
22
        'addressLocality',
23
        'addressRegion',
24
        'postOfficeBoxNumber',
25
        'postalCode',
26
        'streetAddress',
27
    ];
28
29
    /**
30
    * @return array<int, string>
31
    */
32 1
    public function GetAddressLocality() : array
33
    {
34
        /**
35
        * @var array<int, string>
36
        */
37 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
38 1
            'addressLocality',
39 1
            $this->RetrievePropertyValueFromData('addressLocality'),
40 1
            static::class
41
        );
42
43 1
        return $out;
44
    }
45
46
    /**
47
    * @param array<int, string> $value
48
    */
49
    public function SetAddressLocality(array $value) : void
50
    {
51
        $this->NudgePropertyWithUniqueTrimmedStringsMightNotBeString(
52
            'addressLocality',
53
            __METHOD__,
54
            $value
55
        );
56
    }
57
58
    /**
59
    * @return array<int, string>
60
    */
61 1
    public function GetAddressRegion() : array
62
    {
63
        /**
64
        * @var array<int, string>
65
        */
66 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
67 1
            'addressRegion',
68 1
            $this->RetrievePropertyValueFromData('addressRegion'),
69 1
            static::class
70
        );
71
72 1
        return $out;
73
    }
74
75
    /**
76
    * @param array<int, string> $value
77
    */
78
    public function SetAddressRegion(array $value) : void
79
    {
80
        $this->NudgePropertyWithUniqueTrimmedStringsMightNotBeString(
81
            'addressRegion',
82
            __METHOD__,
83
            $value
84
        );
85
    }
86
87
    /**
88
    * @return array<int, string>
89
    */
90 1
    public function GetPostOfficeBoxNumber() : array
91
    {
92
        /**
93
        * @var array<int, string>
94
        */
95 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
96 1
            'postOfficeBoxNumber',
97 1
            $this->RetrievePropertyValueFromData('postOfficeBoxNumber'),
98 1
            static::class
99
        );
100
101 1
        return $out;
102
    }
103
104
    /**
105
    * @param array<int, string> $value
106
    */
107
    public function SetPostOfficeBoxNumber(array $value) : void
108
    {
109
        $this->NudgePropertyWithUniqueTrimmedStringsMightNotBeString(
110
            'postOfficeBoxNumber',
111
            __METHOD__,
112
            $value
113
        );
114
    }
115
116
    /**
117
    * @return array<int, string>
118
    */
119 1
    public function GetStreetAddress() : array
120
    {
121
        /**
122
        * @var array<int, string>
123
        */
124 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
125 1
            'streetAddress',
126 1
            $this->RetrievePropertyValueFromData('streetAddress'),
127 1
            static::class
128
        );
129
130 1
        return $out;
131
    }
132
133
    /**
134
    * @param array<int, string> $value
135
    */
136
    public function SetStreetAddress(array $value) : void
137
    {
138
        $this->NudgePropertyWithUniqueTrimmedStringsMightNotBeString(
139
            'streetAddress',
140
            __METHOD__,
141
            $value
142
        );
143
    }
144
}
145