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

BroadcastService   A

Complexity

Total Complexity 14

Size/Duplication

Total Lines 241
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 89
dl 0
loc 241
ccs 80
cts 80
cp 1
rs 10
c 0
b 0
f 0
wmc 14

14 Methods

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