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

ServiceChannel::GetServicePostalAddress()   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;
8
9
use SignpostMarv\DaftObject\SchemaOrg\DaftObjectTraits;
10
use SignpostMarv\DaftObject\SchemaOrg\DataTypes;
11
use SignpostMarv\DaftObject\SchemaOrg\Intangible as Base;
12
use SignpostMarv\DaftObject\SchemaOrg\Place;
13
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
14
15
class ServiceChannel extends Base
16
{
17
    use DaftObjectTraits\AvailableLanguage;
18
19
    const SCHEMA_ORG_TYPE = 'ServiceChannel';
20
21
    const PROPERTIES = [
22
        'availableLanguage',
23
        'processingTime',
24
        'providesService',
25
        'serviceLocation',
26
        'servicePhone',
27
        'servicePostalAddress',
28
        'serviceSmsNumber',
29
        'serviceUrl',
30
    ];
31
32
    /**
33
    * @return array<int, DataTypes\Duration>
34
    */
35 1
    public function GetProcessingTime() : array
36
    {
37
        /**
38
        * @var array<int, DataTypes\Duration>
39
        */
40 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
41 1
            'processingTime',
42 1
            $this->RetrievePropertyValueFromData('processingTime'),
43 1
            static::class
44
        );
45
46 1
        return $out;
47
    }
48
49
    /**
50
    * @param array<int, DataTypes\Duration> $value
51
    */
52
    public function SetProcessingTime(array $value) : void
53
    {
54
        $this->NudgePropertyWithUniqueValuesOfThings(
55
            'processingTime',
56
            __METHOD__,
57
            $value,
58
            DataTypes\Duration::class
59
        );
60
    }
61
62
    /**
63
    * @return array<int, Service>
64
    */
65 1
    public function GetProvidesService() : array
66
    {
67
        /**
68
        * @var array<int, Service>
69
        */
70 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
71 1
            'providesService',
72 1
            $this->RetrievePropertyValueFromData('providesService'),
73 1
            static::class
74
        );
75
76 1
        return $out;
77
    }
78
79
    /**
80
    * @param array<int, Service> $value
81
    */
82
    public function SetProvidesService(array $value) : void
83
    {
84
        $this->NudgePropertyWithUniqueValuesOfThings(
85
            'providesService',
86
            __METHOD__,
87
            $value,
88
            Service::class
89
        );
90
    }
91
92
    /**
93
    * @return array<int, Place>
94
    */
95 1
    public function GetServiceLocation() : array
96
    {
97
        /**
98
        * @var array<int, Place>
99
        */
100 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
101 1
            'serviceLocation',
102 1
            $this->RetrievePropertyValueFromData('serviceLocation'),
103 1
            static::class
104
        );
105
106 1
        return $out;
107
    }
108
109
    /**
110
    * @param array<int, Place> $value
111
    */
112
    public function SetServiceLocation(array $value) : void
113
    {
114
        $this->NudgePropertyWithUniqueValuesOfThings(
115
            'serviceLocation',
116
            __METHOD__,
117
            $value,
118
            Place::class
119
        );
120
    }
121
122
    /**
123
    * @return array<int, StructuredValue\ContactPoint>
124
    */
125 1
    public function GetServicePhone() : array
126
    {
127
        /**
128
        * @var array<int, StructuredValue\ContactPoint>
129
        */
130 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
131 1
            'servicePhone',
132 1
            $this->RetrievePropertyValueFromData('servicePhone'),
133 1
            static::class
134
        );
135
136 1
        return $out;
137
    }
138
139
    /**
140
    * @param array<int, StructuredValue\ContactPoint> $value
141
    */
142
    public function SetServicePhone(array $value) : void
143
    {
144
        $this->NudgePropertyWithUniqueValuesOfThings(
145
            'servicePhone',
146
            __METHOD__,
147
            $value,
148
            StructuredValue\ContactPoint::class
149
        );
150
    }
151
152
    /**
153
    * @return array<int, StructuredValue\ContactPoint\PostalAddress>
154
    */
155 1
    public function GetServicePostalAddress() : array
156
    {
157
        /**
158
        * @var array<int, StructuredValue\ContactPoint\PostalAddress>
159
        */
160 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
161 1
            'servicePostalAddress',
162 1
            $this->RetrievePropertyValueFromData('servicePostalAddress'),
163 1
            static::class
164
        );
165
166 1
        return $out;
167
    }
168
169
    /**
170
    * @param array<int, StructuredValue\ContactPoint\PostalAddress> $value
171
    */
172
    public function SetServicePostalAddress(array $value) : void
173
    {
174
        $this->NudgePropertyWithUniqueValuesOfThings(
175
            'servicePostalAddress',
176
            __METHOD__,
177
            $value,
178
            StructuredValue\ContactPoint\PostalAddress::class
179
        );
180
    }
181
182
    /**
183
    * @return array<int, StructuredValue\ContactPoint>
184
    */
185 1
    public function GetServiceSmsNumber() : array
186
    {
187
        /**
188
        * @var array<int, StructuredValue\ContactPoint>
189
        */
190 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
191 1
            'serviceSmsNumber',
192 1
            $this->RetrievePropertyValueFromData('serviceSmsNumber'),
193 1
            static::class
194
        );
195
196 1
        return $out;
197
    }
198
199
    /**
200
    * @param array<int, StructuredValue\ContactPoint> $value
201
    */
202
    public function SetServiceSmsNumber(array $value) : void
203
    {
204
        $this->NudgePropertyWithUniqueValuesOfThings(
205
            'serviceSmsNumber',
206
            __METHOD__,
207
            $value,
208
            StructuredValue\ContactPoint::class
209
        );
210
    }
211
212
    /**
213
    * @return array<int, string>
214
    */
215 1
    public function GetServiceUrl() : array
216
    {
217
        /**
218
        * @var array<int, string>
219
        */
220 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
221 1
            'serviceUrl',
222 1
            $this->RetrievePropertyValueFromData('serviceUrl'),
223 1
            static::class
224
        );
225
226 1
        return $out;
227
    }
228
229
    /**
230
    * @param array<int, string> $value
231
    */
232
    public function SetServiceUrl(array $value) : void
233
    {
234
        $this->NudgePropertyWithUniqueTrimmedStringsMightNotBeString(
235
            'serviceUrl',
236
            __METHOD__,
237
            $value
238
        );
239
    }
240
}
241