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

Place::GetHasMap()   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;
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\HasReview;
68
    use DaftObjectTraits\HasTelephone;
69
70
    const SCHEMA_ORG_TYPE = 'Place';
71
72
    const PROPERTIES = [
73
        'additionalProperty',
74
        'address',
75
        'aggregateRating',
76
        'amenityFeature',
77
        'branchCode',
78
        'containedInPlace',
79
        'containsPlace',
80
        'event',
81
        'faxNumber',
82
        'geo',
83
        'geospatiallyContains',
84
        'geospatiallyCoveredBy',
85
        'geospatiallyCovers',
86
        'geospatiallyCrosses',
87
        'geospatiallyDisjoint',
88
        'geospatiallyEquals',
89
        'geospatiallyIntersects',
90
        'geospatiallyOverlaps',
91
        'geospatiallyTouches',
92
        'geospatiallyWithin',
93
        'globalLocationNumber',
94
        'hasMap',
95
        'isAccessibleForFree',
96
        'isicV4',
97
        'logo',
98
        'maximumAttendeeCapacity',
99
        'openingHoursSpecification',
100
        'photo',
101
        'publicAccess',
102
        'review',
103
        'smokingAllowed',
104
        'specialOpeningHoursSpecification',
105
        'telephone',
106
    ];
107
108
    const PROPERTIES_WITH_MULTI_TYPED_ARRAYS = [
109
        'additionalProperty' => [
110
            PropertyValue::class,
111
        ],
112
        'address' => [
113
            'string',
114
            PostalAddress::class,
115
        ],
116
        'aggregateRating' => [
117
            AggregateRating::class,
118
        ],
119
        'amenityFeature' => [
120
            LocationFeatureSpecification::class,
121
        ],
122
        'branchCode' => [
123
            'string',
124
        ],
125
        'containedInPlace' => [
126
            Place::class,
127
        ],
128
        'containsPlace' => [
129
            Place::class,
130
        ],
131
        'event' => [
132
            Event::class,
133
        ],
134
        'faxNumber' => [
135
            'string',
136
        ],
137
        'hasMap' => [
138
            'string',
139
            Map::class,
140
        ],
141
        'geo' => [
142
            GeoCoordinates::class,
143
            GeoShape::class,
144
        ],
145
        'geospatiallyContains' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
146
        'geospatiallyCoveredBy' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
147
        'geospatiallyCovers' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
148
        'geospatiallyCrosses' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
149
        'geospatiallyDisjoint' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
150
        'geospatiallyEquals' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
151
        'geospatiallyIntersects' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
152
        'geospatiallyOverlaps' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
153
        'geospatiallyTouches' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
154
        'geospatiallyWithin' => TypeUtilities::MULTI_TYPE_COMMON__GeospatialGeometry__or__Place,
155
        'globalLocationNumber' => [
156
            'string',
157
        ],
158
        'isAccessibleForFree' => [
159
            'boolean',
160
        ],
161
        'isicV4' => [
162
            'string',
163
        ],
164
        'logo' => [
165
            ImageObject::class,
166
        ],
167
        'maximumAttendeeCapacity' => [
168
            'integer',
169
        ],
170
        'openingHoursSpecification' => [
171
            OpeningHoursSpecification::class,
172
        ],
173
        'photo' => [
174
            ImageObject::class,
175
            Photograph::class,
176
        ],
177
        'publicAccess' => [
178
            'boolean',
179
        ],
180
        'review' => [
181
            Review::class,
182
        ],
183
        'smokingAllowed' => [
184
            'boolean',
185
        ],
186
        'specialOpeningHoursSpecification' => [
187
            OpeningHoursSpecification::class,
188
        ],
189
        'telephone' => [
190
            'string',
191
        ],
192
    ];
193
194
    /**
195
    * @return array<int, LocationFeatureSpecification>
196
    */
197 98
    public function GetAmenityFeature() : array
198
    {
199
        /**
200
        * @var array<int, LocationFeatureSpecification>
201
        */
202 98
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
203 98
            'amenityFeature',
204 98
            $this->RetrievePropertyValueFromData('amenityFeature'),
205 98
            static::class
206
        );
207
208 98
        return $out;
209
    }
210
211
    /**
212
    * @param array<int, LocationFeatureSpecification> $value
213
    */
214 3
    public function SetAmenityFeature(array $value) : void
215
    {
216 3
        $this->NudgePropertyValue(
217 3
            'amenityFeature',
218 3
            $value
219
        );
220 3
    }
221
222
    /**
223
    * @return array<int, string>
224
    */
225 98
    public function GetBranchCode() : array
226
    {
227
        /**
228
        * @var array<int, string>
229
        */
230 98
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
231 98
            'branchCode',
232 98
            $this->RetrievePropertyValueFromData('branchCode'),
233 98
            static::class
234
        );
235
236 98
        return $out;
237
    }
238
239
    /**
240
    * @param array<int, string> $value
241
    */
242 3
    public function SetBranchCode(array $value) : void
243
    {
244 3
        $this->NudgePropertyValue(
245 3
            'branchCode',
246 3
            $value,
247 3
            true
248
        );
249 3
    }
250
251
    /**
252
    * @return array<int, Place>
253
    */
254 98
    public function GetContainedInPlace() : array
255
    {
256
        /**
257
        * @var array<int, Place>
258
        */
259 98
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
260 98
            'containedInPlace',
261 98
            $this->RetrievePropertyValueFromData('containedInPlace'),
262 98
            static::class
263
        );
264
265 98
        return $out;
266
    }
267
268
    /**
269
    * @param array<int, Place> $value
270
    */
271 3
    public function SetContainedInPlace(array $value) : void
272
    {
273 3
        $this->NudgePropertyValue(
274 3
            'containedInPlace',
275 3
            $value
276
        );
277 3
    }
278
279
    /**
280
    * @return array<int, Place>
281
    */
282 98
    public function GetContainsPlace() : array
283
    {
284
        /**
285
        * @var array<int, Place>
286
        */
287 98
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
288 98
            'containsPlace',
289 98
            $this->RetrievePropertyValueFromData('containsPlace'),
290 98
            static::class
291
        );
292
293 98
        return $out;
294
    }
295
296
    /**
297
    * @param array<int, Place> $value
298
    */
299 3
    public function SetContainsPlace(array $value) : void
300
    {
301 3
        $this->NudgePropertyValue(
302 3
            'containsPlace',
303 3
            $value
304
        );
305 3
    }
306
307
    /**
308
    * @return array<int, GeoCoordinates|GeoShape>
309
    */
310 98
    public function GetGeo() : array
311
    {
312
        /**
313
        * @var array<int, GeoCoordinates|GeoShape>
314
        */
315 98
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
316 98
            'geo',
317 98
            $this->RetrievePropertyValueFromData('geo'),
318 98
            static::class
319
        );
320
321 98
        return $out;
322
    }
323
324
    /**
325
    * @param array<int, GeoCoordinates|GeoShape> $value
326
    */
327 3
    public function SetGeo(array $value) : void
328
    {
329 3
        $this->NudgePropertyValue(
330 3
            'geo',
331 3
            $value
332
        );
333 3
    }
334
335
    /**
336
    * @return array<int, string|Map>
337
    */
338 98
    public function GetHasMap() : array
339
    {
340
        /**
341
        * @var array<int, string|Map>
342
        */
343 98
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
344 98
            'hasMap',
345 98
            $this->RetrievePropertyValueFromData('hasMap'),
346 98
            static::class
347
        );
348
349 98
        return $out;
350
    }
351
352
    /**
353
    * @param array<int, string|Map> $value
354
    */
355 3
    public function SetHasMap(array $value) : void
356
    {
357 3
        $this->NudgePropertyValue(
358 3
            'hasMap',
359 3
            $value,
360 3
            true
361
        );
362 3
    }
363
364
    /**
365
    * @return array<int, int>
366
    */
367 98
    public function GetMaximumAttendeeCapacity() : array
368
    {
369
        /**
370
        * @var array<int, int>
371
        */
372 98
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
373 98
            'maximumAttendeeCapacity',
374 98
            $this->RetrievePropertyValueFromData('maximumAttendeeCapacity'),
375 98
            static::class
376
        );
377
378 98
        return $out;
379
    }
380
381
    /**
382
    * @param array<int, int> $value
383
    */
384 3
    public function SetMaximumAttendeeCapacity(array $value) : void
385
    {
386 3
        $this->NudgePropertyValue(
387 3
            'maximumAttendeeCapacity',
388 3
            $value
389
        );
390 3
    }
391
392
    /**
393
    * @return array<int, OpeningHoursSpecification>
394
    */
395 98
    public function GetOpeningHoursSpecification() : array
396
    {
397
        /**
398
        * @var array<int, OpeningHoursSpecification>
399
        */
400 98
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
401 98
            'openingHoursSpecification',
402 98
            $this->RetrievePropertyValueFromData('openingHoursSpecification'),
403 98
            static::class
404
        );
405
406 98
        return $out;
407
    }
408
409
    /**
410
    * @param array<int, OpeningHoursSpecification> $value
411
    */
412 3
    public function SetOpeningHoursSpecification(array $value) : void
413
    {
414 3
        $this->NudgePropertyValue(
415 3
            'openingHoursSpecification',
416 3
            $value
417
        );
418 3
    }
419
420
    /**
421
    * @return array<int, ImageObject|Photograph>
422
    */
423 98
    public function GetPhoto() : array
424
    {
425
        /**
426
        * @var array<int, ImageObject|Photograph>
427
        */
428 98
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
429 98
            'photo',
430 98
            $this->RetrievePropertyValueFromData('photo'),
431 98
            static::class
432
        );
433
434 98
        return $out;
435
    }
436
437
    /**
438
    * @param array<int, ImageObject|Photograph> $value
439
    */
440 3
    public function SetPhoto(array $value) : void
441
    {
442 3
        $this->NudgePropertyValue(
443 3
            'photo',
444 3
            $value
445
        );
446 3
    }
447
448
    /**
449
    * @return array<int, bool>
450
    */
451 98
    public function GetPublicAccess() : array
452
    {
453
        /**
454
        * @var array<int, bool>
455
        */
456 98
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
457 98
            'publicAccess',
458 98
            $this->RetrievePropertyValueFromData('publicAccess'),
459 98
            static::class
460
        );
461
462 98
        return $out;
463
    }
464
465
    /**
466
    * @param array<int, bool> $value
467
    */
468 3
    public function SetPublicAccess(array $value) : void
469
    {
470 3
        $this->NudgePropertyWithUniqueBooleans(
471 3
            'publicAccess',
472 3
            $value
473
        );
474 3
    }
475
476
    /**
477
    * @return array<int, bool>
478
    */
479 98
    public function GetSmokingAllowed() : array
480
    {
481
        /**
482
        * @var array<int, bool>
483
        */
484 98
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
485 98
            'smokingAllowed',
486 98
            $this->RetrievePropertyValueFromData('smokingAllowed'),
487 98
            static::class
488
        );
489
490 98
        return $out;
491
    }
492
493
    /**
494
    * @param array<int, bool> $value
495
    */
496 3
    public function SetSmokingAllowed(array $value) : void
497
    {
498 3
        $this->NudgePropertyWithUniqueBooleans(
499 3
            'smokingAllowed',
500 3
            $value
501
        );
502 3
    }
503
504
    /**
505
    * @return array<int, OpeningHoursSpecification>
506
    */
507 98
    public function GetSpecialOpeningHoursSpecification() : array
508
    {
509
        /**
510
        * @var array<int, OpeningHoursSpecification>
511
        */
512 98
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
513 98
            'specialOpeningHoursSpecification',
514 98
            $this->RetrievePropertyValueFromData('specialOpeningHoursSpecification'),
515 98
            static::class
516
        );
517
518 98
        return $out;
519
    }
520
521
    /**
522
    * @param array<int, OpeningHoursSpecification> $value
523
    */
524 3
    public function SetSpecialOpeningHoursSpecification(array $value) : void
525
    {
526 3
        $this->NudgePropertyValue(
527 3
            'specialOpeningHoursSpecification',
528 3
            $value
529
        );
530 3
    }
531
}
532