Passed
Push — master ( ffa34c...f9eaa3 )
by SignpostMarv
12:18
created

Occupation::SetOccupationLocation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
ccs 4
cts 4
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\Intangible as Base;
10
use SignpostMarv\DaftObject\SchemaOrg\Place\AdministrativeArea;
11
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
12
13
/**
14
* @property array<int, string> $educationRequirements
15
* @property array<int, int|float|StructuredValue\MonetaryAmount|StructuredValue\QuantitativeValue\MonetaryAmountDistribution|StructuredValue\PriceSpecification> $estimatedSalary
16
* @property array<int, string> $experienceRequirements
17
* @property array<int, AdministrativeArea> $occupationLocation
18
* @property array<int, string> $occupationalCategory
19
* @property array<int, string> $qualifications
20
* @property array<int, string> $responsibilities
21
* @property array<int, string> $skills
22
*/
23
class Occupation extends Base
24
{
25
    const SCHEMA_ORG_TYPE = 'Occupation';
26
27
    const PROPERTIES = [
28
        'educationRequirements',
29
        'estimatedSalary',
30
        'experienceRequirements',
31
        'occupationLocation',
32
        'occupationalCategory',
33
        'qualifications',
34
        'responsibilities',
35
        'skills',
36
    ];
37
38
    const PROPERTIES_WITH_MULTI_TYPED_ARRAYS = [
39
        'educationRequirements' => [
40
            'string',
41
        ],
42
        'estimatedSalary' => [
43
            'integer',
44
            'double',
45
            StructuredValue\MonetaryAmount::class,
46
            StructuredValue\QuantitativeValue\MonetaryAmountDistribution::class,
47
            StructuredValue\PriceSpecification::class,
48
        ],
49
        'experienceRequirements' => [
50
            'string',
51
        ],
52
        'occupationLocation' => [
53
            AdministrativeArea::class,
54
        ],
55
        'occupationalCategory' => [
56
            'string',
57
        ],
58
        'qualifications' => [
59
            'string',
60
        ],
61
        'responsibilities' => [
62
            'string',
63
        ],
64
        'skills' => [
65
            'string',
66
        ],
67
    ];
68
69
    /**
70
    * @return array<int, string>
71
    */
72 5
    public function GetEducationRequirements() : array
73
    {
74
        /**
75
        * @var array<int, string>
76
        */
77 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
78 5
            'educationRequirements',
79 5
            $this->RetrievePropertyValueFromData('educationRequirements'),
80 5
            static::class
81
        );
82
83 5
        return $out;
84
    }
85
86
    /**
87
    * @param array<int, string> $value
88
    */
89 1
    public function SetEducationRequirements(array $value) : void
90
    {
91 1
        $this->NudgePropertyValue(
92 1
            'educationRequirements',
93 1
            $value,
94 1
            true
95
        );
96 1
    }
97
98
    /**
99
    * @return array<int, int|float|StructuredValue\MonetaryAmount|StructuredValue\QuantitativeValue\MonetaryAmountDistribution|StructuredValue\PriceSpecification>
100
    */
101 5
    public function GetEstimatedSalary() : array
102
    {
103
        /**
104
        * @var array<int, int|float|StructuredValue\MonetaryAmount|StructuredValue\QuantitativeValue\MonetaryAmountDistribution|StructuredValue\PriceSpecification>
105
        */
106 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
107 5
            'estimatedSalary',
108 5
            $this->RetrievePropertyValueFromData('estimatedSalary'),
109 5
            static::class
110
        );
111
112 5
        return $out;
113
    }
114
115
    /**
116
    * @param array<int, int|float|StructuredValue\MonetaryAmount|StructuredValue\QuantitativeValue\MonetaryAmountDistribution|StructuredValue\PriceSpecification> $value
117
    */
118 1
    public function SetEstimatedSalary(array $value) : void
119
    {
120 1
        $this->NudgePropertyValue(
121 1
            'estimatedSalary',
122 1
            $value
123
        );
124 1
    }
125
126
    /**
127
    * @return array<int, string>
128
    */
129 5
    public function GetExperienceRequirements() : array
130
    {
131
        /**
132
        * @var array<int, string>
133
        */
134 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
135 5
            'experienceRequirements',
136 5
            $this->RetrievePropertyValueFromData('experienceRequirements'),
137 5
            static::class
138
        );
139
140 5
        return $out;
141
    }
142
143
    /**
144
    * @param array<int, string> $value
145
    */
146 1
    public function SetExperienceRequirements(array $value) : void
147
    {
148 1
        $this->NudgePropertyValue(
149 1
            'experienceRequirements',
150 1
            $value,
151 1
            true
152
        );
153 1
    }
154
155
    /**
156
    * @return array<int, AdministrativeArea>
157
    */
158 5
    public function GetOccupationLocation() : array
159
    {
160
        /**
161
        * @var array<int, AdministrativeArea>
162
        */
163 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
164 5
            'occupationLocation',
165 5
            $this->RetrievePropertyValueFromData('occupationLocation'),
166 5
            static::class
167
        );
168
169 5
        return $out;
170
    }
171
172
    /**
173
    * @param array<int, AdministrativeArea> $value
174
    */
175 1
    public function SetOccupationLocation(array $value) : void
176
    {
177 1
        $this->NudgePropertyValue(
178 1
            'occupationLocation',
179 1
            $value
180
        );
181 1
    }
182
183
    /**
184
    * @return array<int, string>
185
    */
186 5
    public function GetOccupationalCategory() : array
187
    {
188
        /**
189
        * @var array<int, string>
190
        */
191 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
192 5
            'occupationalCategory',
193 5
            $this->RetrievePropertyValueFromData('occupationalCategory'),
194 5
            static::class
195
        );
196
197 5
        return $out;
198
    }
199
200
    /**
201
    * @param array<int, string> $value
202
    */
203 1
    public function SetOccupationalCategory(array $value) : void
204
    {
205 1
        $this->NudgePropertyValue(
206 1
            'occupationalCategory',
207 1
            $value,
208 1
            true
209
        );
210 1
    }
211
212
    /**
213
    * @return array<int, string>
214
    */
215 5
    public function GetQualifications() : array
216
    {
217
        /**
218
        * @var array<int, string>
219
        */
220 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
221 5
            'qualifications',
222 5
            $this->RetrievePropertyValueFromData('qualifications'),
223 5
            static::class
224
        );
225
226 5
        return $out;
227
    }
228
229
    /**
230
    * @param array<int, string> $value
231
    */
232 1
    public function SetQualifications(array $value) : void
233
    {
234 1
        $this->NudgePropertyValue(
235 1
            'qualifications',
236 1
            $value,
237 1
            true
238
        );
239 1
    }
240
241
    /**
242
    * @return array<int, string>
243
    */
244 5
    public function GetResponsibilities() : array
245
    {
246
        /**
247
        * @var array<int, string>
248
        */
249 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
250 5
            'responsibilities',
251 5
            $this->RetrievePropertyValueFromData('responsibilities'),
252 5
            static::class
253
        );
254
255 5
        return $out;
256
    }
257
258
    /**
259
    * @param array<int, string> $value
260
    */
261 1
    public function SetResponsibilities(array $value) : void
262
    {
263 1
        $this->NudgePropertyValue(
264 1
            'responsibilities',
265 1
            $value,
266 1
            true
267
        );
268 1
    }
269
270
    /**
271
    * @return array<int, string>
272
    */
273 5
    public function GetSkills() : array
274
    {
275
        /**
276
        * @var array<int, string>
277
        */
278 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
279 5
            'skills',
280 5
            $this->RetrievePropertyValueFromData('skills'),
281 5
            static::class
282
        );
283
284 5
        return $out;
285
    }
286
287
    /**
288
    * @param array<int, string> $value
289
    */
290 1
    public function SetSkills(array $value) : void
291
    {
292 1
        $this->NudgePropertyValue(
293 1
            'skills',
294 1
            $value,
295 1
            true
296
        );
297 1
    }
298
}
299