Test Failed
Branch master (16bdc1)
by SignpostMarv
02:18
created

Place::GetAmenityFeature()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 8
ccs 2
cts 2
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;
8
9
use SignpostMarv\DaftObject\SchemaOrg\CreativeWork\Map;
10
use SignpostMarv\DaftObject\SchemaOrg\CreativeWork\MediaObject\ImageObject;
11
use SignpostMarv\DaftObject\SchemaOrg\CreativeWork\Photograph;
12
use SignpostMarv\DaftObject\SchemaOrg\CreativeWork\Review;
13
use SignpostMarv\DaftObject\SchemaOrg\Intangible\GeospatialGeometry;
14
use SignpostMarv\DaftObject\SchemaOrg\Intangible\Rating\AggregateRating;
15
use SignpostMarv\DaftObject\SchemaOrg\Intangible\StructuredValue\ContactPoint\PostalAddress;
16
use SignpostMarv\DaftObject\SchemaOrg\Intangible\StructuredValue\OpeningHoursSpecification;
17
use SignpostMarv\DaftObject\SchemaOrg\Intangible\StructuredValue\PropertyValue;
18
use SignpostMarv\DaftObject\SchemaOrg\Intangible\StructuredValue\PropertyValue\LocationFeatureSpecification;
19
20
/**
21
* @property array<int, PropertyValue> $additionalProperty
22
* @property array<int, string|PostalAddress> $address
23
* @property array<int, AggregateRating> $aggregateRating
24
* @property array<int, LocationFeatureSpecification> $amenityFeature
25
* @property array<int, string> $branchCode
26
* @property array<int, Place> $containedInPlace
27
* @property array<int, Place> $containsPlace
28
* @property array<int, Event> $event
29
* @property array<int, string> $faxNumber
30
* @property array<int, string|Map> $hasMap
31
* @property array<int, GeoCoordinates|GeoShape> $geo
32
* @property array<int, GeospatialGeometry|Place> $geospatiallyContains
33
* @property array<int, GeospatialGeometry|Place> $geospatiallyCoveredBy
34
* @property array<int, GeospatialGeometry|Place> $geospatiallyCovers
35
* @property array<int, GeospatialGeometry|Place> $geospatiallyCrosses
36
* @property array<int, GeospatialGeometry|Place> $geospatiallyDisjoint
37
* @property array<int, GeospatialGeometry|Place> $geospatiallyEquals
38
* @property array<int, GeospatialGeometry|Place> $geospatiallyIntersects
39
* @property array<int, GeospatialGeometry|Place> $geospatiallyOverlaps
40
* @property array<int, GeospatialGeometry|Place> $geospatiallyTouches
41
* @property array<int, GeospatialGeometry|Place> $geospatiallyWithin
42
* @property array<int, string> $globalLocationNumber
43
* @property array<int, bool> $isAccessibleForFree
44
* @property array<int, string> $isicV4
45
* @property array<int, ImageObject> $logo
46
* @property array<int, int> $maximumAttendeeCapacity
47
* @property array<int, OpeningHoursSpecification> $openingHoursSpecification
48
* @property array<int, ImageObject|Photograph> $photo
49
* @property array<int, bool> $publicAccess
50
* @property array<int, Review> $review
51
* @property array<int, bool> $smokingAllowed
52
* @property array<int, OpeningHoursSpecification> $specialOpeningHoursSpecification
53
* @property array<int, string> $telephone
54
*/
55
class Place extends Thing
56
{
57
    use DaftObjectTraits\TraitAdditionalProperty;
58
    use DaftObjectTraits\HasAddress;
59
    use DaftObjectTraits\HasAggregateRating;
60
    use DaftObjectTraits\HasEvent;
61
    use DaftObjectTraits\HasFaxNumber;
62
    use DaftObjectTraits\HasGeospatialGeometry;
63
    use DaftObjectTraits\HasGlobalLocationNumber;
64
    use DaftObjectTraits\HasIsAccessibleForFree;
65
    use DaftObjectTraits\HasIsicV4;
66
    use DaftObjectTraits\HasLogo;
67
    use DaftObjectTraits\MaximumAttendeeCapacity;
68
    use DaftObjectTraits\HasReview;
69
    use DaftObjectTraits\HasTelephone;
70
71
    const SCHEMA_ORG_TYPE = 'Place';
72
73
    const PROPERTIES = [
74
        'additionalProperty',
75
        'address',
76
        'aggregateRating',
77
        'amenityFeature',
78
        'branchCode',
79
        'containedInPlace',
80
        'containsPlace',
81
        'event',
82
        'faxNumber',
83
        'geo',
84
        'geospatiallyContains',
85
        'geospatiallyCoveredBy',
86
        'geospatiallyCovers',
87
        'geospatiallyCrosses',
88
        'geospatiallyDisjoint',
89
        'geospatiallyEquals',
90
        'geospatiallyIntersects',
91
        'geospatiallyOverlaps',
92
        'geospatiallyTouches',
93
        'geospatiallyWithin',
94
        'globalLocationNumber',
95
        'hasMap',
96
        'isAccessibleForFree',
97
        'isicV4',
98
        'logo',
99
        'maximumAttendeeCapacity',
100
        'openingHoursSpecification',
101
        'photo',
102
        'publicAccess',
103
        'review',
104
        'smokingAllowed',
105
        'specialOpeningHoursSpecification',
106
        'telephone',
107
    ];
108
109
    const PROPERTIES_WITH_MULTI_TYPED_ARRAYS = [
110
        'additionalProperty' => [
111
            PropertyValue::class,
112
        ],
113
        'address' => [
114
            'string',
115
            PostalAddress::class,
116
        ],
117
        'aggregateRating' => [
118
            AggregateRating::class,
119
        ],
120
        'amenityFeature' => [
121
            LocationFeatureSpecification::class,
122
        ],
123
        'branchCode' => [
124
            'string',
125
        ],
126
        'containedInPlace' => [
127
            Place::class,
128
        ],
129
        'containsPlace' => [
130
            Place::class,
131
        ],
132
        'event' => [
133
            Event::class,
134
        ],
135
        'faxNumber' => [
136
            'string',
137
        ],
138
        'hasMap' => [
139
            'string',
140
            Map::class,
141
        ],
142
        'geo' => [
143
            GeoCoordinates::class,
144
            GeoShape::class,
145
        ],
146
        'geospatiallyContains' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
147
        'geospatiallyCoveredBy' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
148
        'geospatiallyCovers' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
149
        'geospatiallyCrosses' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
150
        'geospatiallyDisjoint' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
151
        'geospatiallyEquals' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
152
        'geospatiallyIntersects' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
153
        'geospatiallyOverlaps' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
154
        'geospatiallyTouches' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
155
        'geospatiallyWithin' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
156
        'globalLocationNumber' => [
157
            'string',
158
        ],
159
        'isAccessibleForFree' => [
160
            'boolean',
161
        ],
162
        'isicV4' => [
163
            'string',
164
        ],
165
        'logo' => [
166
            ImageObject::class,
167
        ],
168
        'maximumAttendeeCapacity' => [
169
            'integer',
170
        ],
171
        'openingHoursSpecification' => [
172
            OpeningHoursSpecification::class,
173
        ],
174
        'photo' => [
175
            ImageObject::class,
176
            Photograph::class,
177
        ],
178
        'publicAccess' => [
179
            'boolean',
180
        ],
181
        'review' => [
182
            Review::class,
183
        ],
184
        'smokingAllowed' => [
185
            'boolean',
186
        ],
187
        'specialOpeningHoursSpecification' => [
188
            OpeningHoursSpecification::class,
189
        ],
190
        'telephone' => [
191
            'string',
192
        ],
193
    ];
194
195
    /**
196
    * @return array<int, LocationFeatureSpecification>
197 98
    */
198
    public function GetAmenityFeature() : array
199
    {
200
        /**
201
        * @var array<int, LocationFeatureSpecification>
202 98
        */
203
        $out = $this->ExpectRetrievedValueIsArray('amenityFeature');
204 98
205
        return $out;
206
    }
207
208
    /**
209
    * @param array<int, LocationFeatureSpecification> $value
210 3
    */
211
    public function SetAmenityFeature(array $value) : void
212 3
    {
213 3
        $this->NudgePropertyValue('amenityFeature', $value);
214
    }
215
216
    /**
217
    * @return array<int, string>
218 98
    */
219
    public function GetBranchCode() : array
220
    {
221
        /**
222
        * @var array<int, string>
223 98
        */
224
        $out = $this->ExpectRetrievedValueIsArray('branchCode');
225 98
226
        return $out;
227
    }
228
229
    /**
230
    * @param array<int, string> $value
231 3
    */
232
    public function SetBranchCode(array $value) : void
233 3
    {
234 3
        $this->NudgePropertyValue('branchCode', $value, true);
235
    }
236
237
    /**
238
    * @return array<int, Place>
239 98
    */
240
    public function GetContainedInPlace() : array
241
    {
242
        /**
243
        * @var array<int, Place>
244 98
        */
245
        $out = $this->ExpectRetrievedValueIsArray('containedInPlace');
246 98
247
        return $out;
248
    }
249
250
    /**
251
    * @param array<int, Place> $value
252 3
    */
253
    public function SetContainedInPlace(array $value) : void
254 3
    {
255 3
        $this->NudgePropertyValue('containedInPlace', $value);
256
    }
257
258
    /**
259
    * @return array<int, Place>
260 98
    */
261
    public function GetContainsPlace() : array
262
    {
263
        /**
264
        * @var array<int, Place>
265 98
        */
266
        $out = $this->ExpectRetrievedValueIsArray('containsPlace');
267 98
268
        return $out;
269
    }
270
271
    /**
272
    * @param array<int, Place> $value
273 3
    */
274
    public function SetContainsPlace(array $value) : void
275 3
    {
276 3
        $this->NudgePropertyValue('containsPlace', $value);
277
    }
278
279
    /**
280
    * @return array<int, GeoCoordinates|GeoShape>
281 98
    */
282
    public function GetGeo() : array
283
    {
284
        /**
285
        * @var array<int, GeoCoordinates|GeoShape>
286 98
        */
287
        $out = $this->ExpectRetrievedValueIsArray('geo');
288 98
289
        return $out;
290
    }
291
292
    /**
293
    * @param array<int, GeoCoordinates|GeoShape> $value
294 3
    */
295
    public function SetGeo(array $value) : void
296 3
    {
297 3
        $this->NudgePropertyValue('geo', $value);
298
    }
299
300
    /**
301
    * @return array<int, string|Map>
302 98
    */
303
    public function GetHasMap() : array
304
    {
305
        /**
306
        * @var array<int, string|Map>
307 98
        */
308
        $out = $this->ExpectRetrievedValueIsArray('hasMap');
309 98
310
        return $out;
311
    }
312
313
    /**
314
    * @param array<int, string|Map> $value
315 3
    */
316
    public function SetHasMap(array $value) : void
317 3
    {
318 3
        $this->NudgePropertyValue('hasMap', $value, true);
319
    }
320
321
    /**
322
    * @return array<int, OpeningHoursSpecification>
323 98
    */
324
    public function GetOpeningHoursSpecification() : array
325
    {
326
        /**
327
        * @var array<int, OpeningHoursSpecification>
328 98
        */
329
        $out = $this->ExpectRetrievedValueIsArray('openingHoursSpecification');
330 98
331
        return $out;
332
    }
333
334
    /**
335
    * @param array<int, OpeningHoursSpecification> $value
336 3
    */
337
    public function SetOpeningHoursSpecification(array $value) : void
338 3
    {
339 3
        $this->NudgePropertyValue('openingHoursSpecification', $value);
340
    }
341
342
    /**
343
    * @return array<int, ImageObject|Photograph>
344 98
    */
345
    public function GetPhoto() : array
346
    {
347
        /**
348
        * @var array<int, ImageObject|Photograph>
349 98
        */
350
        $out = $this->ExpectRetrievedValueIsArray('photo');
351 98
352
        return $out;
353
    }
354
355
    /**
356
    * @param array<int, ImageObject|Photograph> $value
357 3
    */
358
    public function SetPhoto(array $value) : void
359 3
    {
360 3
        $this->NudgePropertyValue('photo', $value);
361
    }
362
363
    /**
364
    * @return array<int, bool>
365 98
    */
366
    public function GetPublicAccess() : array
367
    {
368
        /**
369
        * @var array<int, bool>
370 98
        */
371
        $out = $this->ExpectRetrievedValueIsArray('publicAccess');
372 98
373
        return $out;
374
    }
375
376
    /**
377
    * @param array<int, bool> $value
378 3
    */
379
    public function SetPublicAccess(array $value) : void
380 3
    {
381 3
        $this->NudgePropertyWithUniqueBooleans('publicAccess', $value);
382
    }
383
384
    /**
385
    * @return array<int, bool>
386 98
    */
387
    public function GetSmokingAllowed() : array
388
    {
389
        /**
390
        * @var array<int, bool>
391 98
        */
392
        $out = $this->ExpectRetrievedValueIsArray('smokingAllowed');
393 98
394
        return $out;
395
    }
396
397
    /**
398
    * @param array<int, bool> $value
399 3
    */
400
    public function SetSmokingAllowed(array $value) : void
401 3
    {
402 3
        $this->NudgePropertyWithUniqueBooleans('smokingAllowed', $value);
403
    }
404
405
    /**
406
    * @return array<int, OpeningHoursSpecification>
407 98
    */
408
    public function GetSpecialOpeningHoursSpecification() : array
409
    {
410
        /**
411
        * @var array<int, OpeningHoursSpecification>
412 98
        */
413
        $out = $this->ExpectRetrievedValueIsArray('specialOpeningHoursSpecification');
414 98
415
        return $out;
416
    }
417
418
    /**
419
    * @param array<int, OpeningHoursSpecification> $value
420 3
    */
421
    public function SetSpecialOpeningHoursSpecification(array $value) : void
422 3
    {
423 3
        $this->NudgePropertyValue('specialOpeningHoursSpecification', $value);
424
    }
425
}
426