Passed
Push — master ( df1a48...669ccb )
by SignpostMarv
04:37
created

Event   A

Complexity

Total Complexity 32

Size/Duplication

Total Lines 478
Duplicated Lines 0 %

Test Coverage

Coverage 58.9%

Importance

Changes 0
Metric Value
eloc 167
dl 0
loc 478
ccs 96
cts 163
cp 0.589
rs 9.84
c 0
b 0
f 0
wmc 32

32 Methods

Rating   Name   Duplication   Size   Complexity  
A SetWorkPerformed() 0 7 1
A SetContributor() 0 3 1
A SetRecordedIn() 0 7 1
A SetMaximumAttendeeCapacity() 0 3 1
A SetSubEvent() 0 3 1
A SetEndDate() 0 3 1
A SetStartDate() 0 3 1
A SetPerformer() 0 3 1
A SetEventStatus() 0 7 1
A SetSuperEvent() 0 3 1
A SetDoorTime() 0 7 1
A SetWorkFeatured() 0 7 1
A SetOrganizer() 0 3 1
A SetPreviousStartDate() 0 3 1
A SetAttendee() 0 3 1
A SetRemainingAttendeeCapacity() 0 3 1
A GetSuperEvent() 0 12 1
A GetRemainingAttendeeCapacity() 0 12 1
A GetDoorTime() 0 12 1
A GetEventStatus() 0 12 1
A GetRecordedIn() 0 12 1
A GetContributor() 0 12 1
A GetPerformer() 0 12 1
A GetEndDate() 0 12 1
A GetWorkPerformed() 0 12 1
A GetMaximumAttendeeCapacity() 0 12 1
A GetWorkFeatured() 0 12 1
A GetSubEvent() 0 12 1
A GetStartDate() 0 12 1
A GetOrganizer() 0 12 1
A GetAttendee() 0 12 1
A GetPreviousStartDate() 0 12 1
1
<?php
2
/**
3
* @author SignpostMarv
4
*/
5
declare(strict_types=1);
6
7
namespace SignpostMarv\DaftObject\SchemaOrg;
8
9
use SignpostMarv\DaftObject\SchemaOrg\DataTypes\Date;
10
use SignpostMarv\DaftObject\SchemaOrg\DataTypes\DateTime;
11
use SignpostMarv\DaftObject\SchemaOrg\Intangible\Enumeration\EventStatusType;
12
13
class Event extends Thing
14
{
15
    use DaftObjectTraits\HasAboutThing;
16
    use DaftObjectTraits\HasActor;
17
    use DaftObjectTraits\HasAggregateRating;
18
    use DaftObjectTraits\HasAudience;
19
    use DaftObjectTraits\Composer;
20
    use DaftObjectTraits\HasDirector;
21
    use DaftObjectTraits\Duration;
22
    use DaftObjectTraits\HasFunder;
23
    use DaftObjectTraits\HasInLanguage;
24
    use DaftObjectTraits\HasIsAccessibleForFree;
25
    use DaftObjectTraits\HasLocation;
26
    use DaftObjectTraits\HasOffers;
27
    use DaftObjectTraits\HasReview;
28
    use DaftObjectTraits\HasSponsors;
29
    use DaftObjectTraits\HasTranslators;
30
    use DaftObjectTraits\HasTypicalAgeRanges;
31
32
    const SCHEMA_ORG_TYPE = 'Event';
33
34
    const PROPERTIES = [
35
        'about',
36
        'actor',
37
        'aggregateRating',
38
        'attendee',
39
        'audience',
40
        'composer',
41
        'contributor',
42
        'director',
43
        'doorTime',
44
        'duration',
45
        'endDate',
46
        'eventStatus',
47
        'funder',
48
        'inLanguage',
49
        'isAccessibleForFree',
50
        'location',
51
        'maximumAttendeeCapacity',
52
        'offers',
53
        'organizer',
54
        'performer',
55
        'previousStartDate',
56
        'recordedIn',
57
        'remainingAttendeeCapacity',
58
        'review',
59
        'sponsor',
60
        'startDate',
61
        'subEvent',
62
        'superEvent',
63
        'translator',
64
        'typicalAgeRange',
65
        'workFeatured',
66
        'workPerformed',
67
    ];
68
69
    /**
70
    * @return array<int, Organization|Person>
71
    */
72 4
    public function GetAttendee() : array
73
    {
74
        /**
75
        * @var array<int, Organization|Person>
76
        */
77 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
78 4
            'attendee',
79 4
            $this->RetrievePropertyValueFromData('attendee'),
80 4
            static::class
81
        );
82
83 4
        return $out;
84
    }
85
86
    /**
87
    * @param array<int, Organization|Person> $value
88
    */
89
    public function SetAttendee(array $value) : void
90
    {
91
        $this->NudgePropertyWithUniqueOrganizationsOrPersons('attendee', __METHOD__, $value);
92
    }
93
94
    /**
95
    * @return array<int, Organization|Person>
96
    */
97 4
    public function GetContributor() : array
98
    {
99
        /**
100
        * @var array<int, Organization|Person>
101
        */
102 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
103 4
            'contributor',
104 4
            $this->RetrievePropertyValueFromData('contributor'),
105 4
            static::class
106
        );
107
108 4
        return $out;
109
    }
110
111
    /**
112
    * @param array<int, Organization|Person> $value
113
    */
114
    public function SetContributor(array $value) : void
115
    {
116
        $this->NudgePropertyWithUniqueOrganizationsOrPersons('contributor', __METHOD__, $value);
117
    }
118
119
    /**
120
    * @return array<int, DateTime>
121
    */
122 4
    public function GetDoorTime() : array
123
    {
124
        /**
125
        * @var array<int, DateTime>
126
        */
127 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
128 4
            'doorTime',
129 4
            $this->RetrievePropertyValueFromData('doorTime'),
130 4
            static::class
131
        );
132
133 4
        return $out;
134
    }
135
136
    /**
137
    * @param array<int, DateTime> $value
138
    */
139
    public function SetDoorTime(array $value) : void
140
    {
141
        $this->NudgePropertyWithUniqueValuesOfThings(
142
            'doorTime',
143
            __METHOD__,
144
            $value,
145
            DateTime::class
146
        );
147
    }
148
149
    /**
150
    * @return array<int, Date|DateTime>
151
    */
152 4
    public function GetEndDate() : array
153
    {
154
        /**
155
        * @var array<int, Date|DateTime>
156
        */
157 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
158 4
            'endDate',
159 4
            $this->RetrievePropertyValueFromData('endDate'),
160 4
            static::class
161
        );
162
163 4
        return $out;
164
    }
165
166
    /**
167
    * @param array<int, Date|DateTime> $value
168
    */
169
    public function SetEndDate(array $value) : void
170
    {
171
        $this->NudgePropertyWithUniqueDatesOrDateTimes('endDate', __METHOD__, $value);
172
    }
173
174
    /**
175
    * @return array<int, EventStatusType>
176
    */
177 4
    public function GetEventStatus() : array
178
    {
179
        /**
180
        * @var array<int, EventStatusType>
181
        */
182 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
183 4
            'eventStatus',
184 4
            $this->RetrievePropertyValueFromData('eventStatus'),
185 4
            static::class
186
        );
187
188 4
        return $out;
189
    }
190
191
    /**
192
    * @param array<int, EventStatusType> $value
193
    */
194
    public function SetEventStatus(array $value) : void
195
    {
196
        $this->NudgePropertyWithUniqueValuesOfThings(
197
            'eventStatus',
198
            __METHOD__,
199
            $value,
200
            EventStatusType::class
201
        );
202
    }
203
204
    /**
205
    * @return array<int, Organization|Person>
206
    */
207 4
    public function GetMaximumAttendeeCapacity() : array
208
    {
209
        /**
210
        * @var array<int, Organization|Person>
211
        */
212 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
213 4
            'maximumAttendeeCapacity',
214 4
            $this->RetrievePropertyValueFromData('maximumAttendeeCapacity'),
215 4
            static::class
216
        );
217
218 4
        return $out;
219
    }
220
221
    /**
222
    * @param array<int, Organization|Person> $value
223
    */
224
    public function SetMaximumAttendeeCapacity(array $value) : void
225
    {
226
        $this->NudgePropertyWithUniqueValues('maximumAttendeeCapacity', __METHOD__, $value);
227
    }
228
229
    /**
230
    * @return array<int, Organization|Person>
231
    */
232 4
    public function GetOrganizer() : array
233
    {
234
        /**
235
        * @var array<int, Organization|Person>
236
        */
237 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
238 4
            'organizer',
239 4
            $this->RetrievePropertyValueFromData('organizer'),
240 4
            static::class
241
        );
242
243 4
        return $out;
244
    }
245
246
    /**
247
    * @param array<int, Organization|Person> $value
248
    */
249
    public function SetOrganizer(array $value) : void
250
    {
251
        $this->NudgePropertyWithUniqueOrganizationsOrPersons('organizer', __METHOD__, $value);
252
    }
253
254
    /**
255
    * @return array<int, Organization|Person>
256
    */
257 4
    public function GetPerformer() : array
258
    {
259
        /**
260
        * @var array<int, Organization|Person>
261
        */
262 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
263 4
            'performer',
264 4
            $this->RetrievePropertyValueFromData('performer'),
265 4
            static::class
266
        );
267
268 4
        return $out;
269
    }
270
271
    /**
272
    * @param array<int, Organization|Person> $value
273
    */
274
    public function SetPerformer(array $value) : void
275
    {
276
        $this->NudgePropertyWithUniqueOrganizationsOrPersons('performer', __METHOD__, $value);
277
    }
278
279
    /**
280
    * @return array<int, Date>
281
    */
282 4
    public function GetPreviousStartDate() : array
283
    {
284
        /**
285
        * @var array<int, Date>
286
        */
287 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
288 4
            'previousStartDate',
289 4
            $this->RetrievePropertyValueFromData('previousStartDate'),
290 4
            static::class
291
        );
292
293 4
        return $out;
294
    }
295
296
    /**
297
    * @param array<int, Date> $value
298
    */
299
    public function SetPreviousStartDate(array $value) : void
300
    {
301
        $this->NudgePropertyWithUniqueDates('previousStartDate', __METHOD__, $value);
302
    }
303
304
    /**
305
    * @return array<int, CreativeWork>
306
    */
307 4
    public function GetRecordedIn() : array
308
    {
309
        /**
310
        * @var array<int, CreativeWork>
311
        */
312 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
313 4
            'recordedIn',
314 4
            $this->RetrievePropertyValueFromData('recordedIn'),
315 4
            static::class
316
        );
317
318 4
        return $out;
319
    }
320
321
    /**
322
    * @param array<int, CreativeWork> $value
323
    */
324
    public function SetRecordedIn(array $value) : void
325
    {
326
        $this->NudgePropertyWithUniqueValuesOfThings(
327
            'recordedIn',
328
            __METHOD__,
329
            $value,
330
            CreativeWork::class
331
        );
332
    }
333
334
    /**
335
    * @return array<int, int>
336
    */
337 4
    public function GetRemainingAttendeeCapacity() : array
338
    {
339
        /**
340
        * @var array<int, int>
341
        */
342 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
343 4
            'remainingAttendeeCapacity',
344 4
            $this->RetrievePropertyValueFromData('remainingAttendeeCapacity'),
345 4
            static::class
346
        );
347
348 4
        return $out;
349
    }
350
351
    /**
352
    * @param array<int, int> $value
353
    */
354
    public function SetRemainingAttendeeCapacity(array $value) : void
355
    {
356
        $this->NudgePropertyWithUniqueIntegers('remainingAttendeeCapacity', __METHOD__, $value);
357
    }
358
359
    /**
360
    * @return array<int, Date>
361
    */
362 4
    public function GetStartDate() : array
363
    {
364
        /**
365
        * @var array<int, Date>
366
        */
367 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
368 4
            'startDate',
369 4
            $this->RetrievePropertyValueFromData('startDate'),
370 4
            static::class
371
        );
372
373 4
        return $out;
374
    }
375
376
    /**
377
    * @param array<int, Date> $value
378
    */
379
    public function SetStartDate(array $value) : void
380
    {
381
        $this->NudgePropertyWithUniqueDatesOrDateTimes('startDate', __METHOD__, $value);
382
    }
383
384
    /**
385
    * @return array<int, Event>
386
    */
387 4
    public function GetSubEvent() : array
388
    {
389
        /**
390
        * @var array<int, Event>
391
        */
392 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
393 4
            'subEvent',
394 4
            $this->RetrievePropertyValueFromData('subEvent'),
395 4
            static::class
396
        );
397
398 4
        return $out;
399
    }
400
401
    /**
402
    * @param array<int, Event> $value
403
    */
404
    public function SetSubEvent(array $value) : void
405
    {
406
        $this->NudgePropertyWithUniqueEvents('subEvent', __METHOD__, $value);
407
    }
408
409
    /**
410
    * @return array<int, Event>
411
    */
412 4
    public function GetSuperEvent() : array
413
    {
414
        /**
415
        * @var array<int, Event>
416
        */
417 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
418 4
            'superEvent',
419 4
            $this->RetrievePropertyValueFromData('superEvent'),
420 4
            static::class
421
        );
422
423 4
        return $out;
424
    }
425
426
    /**
427
    * @param array<int, Event> $value
428
    */
429
    public function SetSuperEvent(array $value) : void
430
    {
431
        $this->NudgePropertyWithUniqueEvents('superEvent', __METHOD__, $value);
432
    }
433
434
    /**
435
    * @return array<int, CreativeWork>
436
    */
437 4
    public function GetWorkFeatured() : array
438
    {
439
        /**
440
        * @var array<int, CreativeWork>
441
        */
442 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
443 4
            'workFeatured',
444 4
            $this->RetrievePropertyValueFromData('workFeatured'),
445 4
            static::class
446
        );
447
448 4
        return $out;
449
    }
450
451
    /**
452
    * @param array<int, CreativeWork> $value
453
    */
454
    public function SetWorkFeatured(array $value) : void
455
    {
456
        $this->NudgePropertyWithUniqueValuesOfThings(
457
            'workFeatured',
458
            __METHOD__,
459
            $value,
460
            CreativeWork::class
461
        );
462
    }
463
464
    /**
465
    * @return array<int, CreativeWork>
466
    */
467 4
    public function GetWorkPerformed() : array
468
    {
469
        /**
470
        * @var array<int, CreativeWork>
471
        */
472 4
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
473 4
            'workPerformed',
474 4
            $this->RetrievePropertyValueFromData('workPerformed'),
475 4
            static::class
476
        );
477
478 4
        return $out;
479
    }
480
481
    /**
482
    * @param array<int, CreativeWork> $value
483
    */
484
    public function SetWorkPerformed(array $value) : void
485
    {
486
        $this->NudgePropertyWithUniqueValuesOfThings(
487
            'workPerformed',
488
            __METHOD__,
489
            $value,
490
            CreativeWork::class
491
        );
492
    }
493
}
494