Passed
Push — master ( 6d0f47...81601f )
by SignpostMarv
12:06
created

BroadcastService::SetBroadcastAffiliateOf()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
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 1
dl 0
loc 7
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\Service;
8
9
use SignpostMarv\DaftObject\SchemaOrg\Intangible\BroadcastChannel;
10
use SignpostMarv\DaftObject\SchemaOrg\Intangible\BroadcastFrequencySpecification;
11
use SignpostMarv\DaftObject\SchemaOrg\Intangible\Service as Base;
12
use SignpostMarv\DaftObject\SchemaOrg\Organization;
13
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
14
15
/**
16
* @property array<int, Organization> $broadcastAffiliateOf
17
* @property array<int, string> $broadcastDisplayName
18
* @property array<int, string|BroadcastFrequencySpecification> $broadcastFrequency
19
* @property array<int, string> $broadcastTimezone
20
* @property array<int, Organization> $broadcaster
21
* @property array<int, BroadcastChannel> $hasBroadcastChannel
22
* @property array<int, BroadcastService> $parentService
23
* @property array<int, string> $videoFormat
24
*/
25
class BroadcastService extends Base
26
{
27
    const SCHEMA_ORG_TYPE = 'BroadcastService';
28
29
    const PROPERTIES = [
30
        'broadcastAffiliateOf',
31
        'broadcastDisplayName',
32
        'broadcastFrequency',
33
        'broadcastTimezone',
34
        'broadcaster',
35
        'hasBroadcastChannel',
36
        'parentService',
37
        'videoFormat',
38
    ];
39
40
    const PROPERTIES_WITH_MULTI_TYPED_ARRAYS = [
41
        'broadcastAffiliateOf' => [
42
            Organization::class,
43
        ],
44
        'broadcastDisplayName' => [
45
            'string',
46
        ],
47
        'broadcastFrequency' => [
48
            'string',
49
            BroadcastFrequencySpecification::class,
50
        ],
51
        'broadcastTimezone' => [
52
            'string',
53
        ],
54
        'broadcaster' => [
55
            Organization::class,
56
        ],
57
        'hasBroadcastChannel' => [
58
            BroadcastChannel::class,
59
        ],
60
        'parentService' => [
61
            BroadcastService::class,
62
        ],
63
        'videoFormat' => [
64
            'string',
65
        ],
66
    ];
67
68
    /**
69
    * @return array<int, Organization>
70
    */
71 5
    public function GetBroadcastAffiliateOf() : array
72
    {
73
        /**
74
        * @var array<int, Organization>
75
        */
76 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
77 5
            'broadcastAffiliateOf',
78 5
            $this->RetrievePropertyValueFromData('broadcastAffiliateOf'),
79 5
            static::class
80
        );
81
82 5
        return $out;
83
    }
84
85
    /**
86
    * @param array<int, Organization> $value
87
    */
88 1
    public function SetBroadcastAffiliateOf(array $value) : void
89
    {
90 1
        $this->NudgePropertyWithUniqueValuesOfThings(
91 1
            'broadcastAffiliateOf',
92 1
            __METHOD__,
93 1
            $value,
94 1
            Organization::class
95
        );
96 1
    }
97
98
    /**
99
    * @return array<int, string>
100
    */
101 5
    public function GetBroadcastDisplayName() : array
102
    {
103
        /**
104
        * @var array<int, string>
105
        */
106 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
107 5
            'broadcastDisplayName',
108 5
            $this->RetrievePropertyValueFromData('broadcastDisplayName'),
109 5
            static::class
110
        );
111
112 5
        return $out;
113
    }
114
115
    /**
116
    * @param array<int, string> $value
117
    */
118 1
    public function SetBroadcastDisplayName(array $value) : void
119
    {
120 1
        $this->NudgePropertyWithUniqueTrimmedStringsMightNotBeString(
121 1
            'broadcastDisplayName',
122 1
            __METHOD__,
123 1
            $value
124
        );
125 1
    }
126
127
    /**
128
    * @return array<int, string|BroadcastFrequencySpecification>
129
    */
130 5
    public function GetBroadcastFrequency() : array
131
    {
132
        /**
133
        * @var array<int, string|BroadcastFrequencySpecification>
134
        */
135 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
136 5
            'broadcastFrequency',
137 5
            $this->RetrievePropertyValueFromData('broadcastFrequency'),
138 5
            static::class
139
        );
140
141 5
        return $out;
142
    }
143
144
    /**
145
    * @param array<int, string|BroadcastFrequencySpecification> $value
146
    */
147 1
    public function SetBroadcastFrequency(array $value) : void
148
    {
149 1
        $this->NudgePropertyWithUniqueTrimmedStringsOrThings(
150 1
            'broadcastFrequency',
151 1
            __METHOD__,
152 1
            $value,
153 1
            BroadcastFrequencySpecification::class
154
        );
155 1
    }
156
157
    /**
158
    * @return array<int, string>
159
    */
160 5
    public function GetBroadcastTimezone() : array
161
    {
162
        /**
163
        * @var array<int, string>
164
        */
165 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
166 5
            'broadcastTimezone',
167 5
            $this->RetrievePropertyValueFromData('broadcastTimezone'),
168 5
            static::class
169
        );
170
171 5
        return $out;
172
    }
173
174
    /**
175
    * @param array<int, string> $value
176
    */
177 1
    public function SetBroadcastTimezone(array $value) : void
178
    {
179 1
        $this->NudgePropertyWithUniqueTrimmedStringsMightNotBeString(
180 1
            'broadcastTimezone',
181 1
            __METHOD__,
182 1
            $value
183
        );
184 1
    }
185
186
    /**
187
    * @return array<int, Organization>
188
    */
189 5
    public function GetBroadcaster() : array
190
    {
191
        /**
192
        * @var array<int, Organization>
193
        */
194 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
195 5
            'broadcaster',
196 5
            $this->RetrievePropertyValueFromData('broadcaster'),
197 5
            static::class
198
        );
199
200 5
        return $out;
201
    }
202
203
    /**
204
    * @param array<int, Organization> $value
205
    */
206 1
    public function SetBroadcaster(array $value) : void
207
    {
208 1
        $this->NudgePropertyWithUniqueValuesOfThings(
209 1
            'broadcaster',
210 1
            __METHOD__,
211 1
            $value,
212 1
            Organization::class
213
        );
214 1
    }
215
216
    /**
217
    * @return array<int, BroadcastChannel>
218
    */
219 5
    public function GetHasBroadcastChannel() : array
220
    {
221
        /**
222
        * @var array<int, BroadcastChannel>
223
        */
224 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
225 5
            'hasBroadcastChannel',
226 5
            $this->RetrievePropertyValueFromData('hasBroadcastChannel'),
227 5
            static::class
228
        );
229
230 5
        return $out;
231
    }
232
233
    /**
234
    * @param array<int, BroadcastChannel> $value
235
    */
236 1
    public function SetHasBroadcastChannel(array $value) : void
237
    {
238 1
        $this->NudgePropertyWithUniqueValuesOfThings(
239 1
            'hasBroadcastChannel',
240 1
            __METHOD__,
241 1
            $value,
242 1
            BroadcastChannel::class
243
        );
244 1
    }
245
246
    /**
247
    * @return array<int, BroadcastService>
248
    */
249 5
    public function GetParentService() : array
250
    {
251
        /**
252
        * @var array<int, BroadcastService>
253
        */
254 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
255 5
            'parentService',
256 5
            $this->RetrievePropertyValueFromData('parentService'),
257 5
            static::class
258
        );
259
260 5
        return $out;
261
    }
262
263
    /**
264
    * @param array<int, BroadcastService> $value
265
    */
266 1
    public function SetParentService(array $value) : void
267
    {
268 1
        $this->NudgePropertyWithUniqueValuesOfThings(
269 1
            'parentService',
270 1
            __METHOD__,
271 1
            $value,
272 1
            BroadcastService::class
273
        );
274 1
    }
275
276
    /**
277
    * @return array<int, string>
278
    */
279 5
    public function GetVideoFormat() : array
280
    {
281
        /**
282
        * @var array<int, string>
283
        */
284 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
285 5
            'videoFormat',
286 5
            $this->RetrievePropertyValueFromData('videoFormat'),
287 5
            static::class
288
        );
289
290 5
        return $out;
291
    }
292
293
    /**
294
    * @param array<int, string> $value
295
    */
296 1
    public function SetVideoFormat(array $value) : void
297
    {
298 1
        $this->NudgePropertyWithUniqueTrimmedStringsMightNotBeString(
299 1
            'videoFormat',
300 1
            __METHOD__,
301 1
            $value
302
        );
303 1
    }
304
}
305