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

BroadcastChannel::SetInBroadcastLineup()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
ccs 4
cts 4
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;
8
9
use SignpostMarv\DaftObject\SchemaOrg\DaftObjectTraits;
10
use SignpostMarv\DaftObject\SchemaOrg\Intangible as Base;
11
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
12
13
/**
14
* @property array<int, string> $broadcastChannelId
15
* @property array<int, string|BroadcastFrequencySpecification> $broadcastFrequency
16
* @property array<int, string> $broadcastServiceTier
17
* @property array<int, string> $genre
18
* @property array<int, Service\CableOrSatelliteService> $inBroadcastLineup
19
* @property array<int, Service\BroadcastService> $providesBroadcastService
20
*/
21
class BroadcastChannel extends Base
22
{
23
    use DaftObjectTraits\BroadcastFrequency;
24
    use DaftObjectTraits\Genre;
25
26
    const SCHEMA_ORG_TYPE = 'BroadcastChannel';
27
28
    const PROPERTIES = [
29
        'broadcastChannelId',
30
        'broadcastFrequency',
31
        'broadcastServiceTier',
32
        'genre',
33
        'inBroadcastLineup',
34
        'providesBroadcastService',
35
    ];
36
37
    const PROPERTIES_WITH_MULTI_TYPED_ARRAYS = [
38
        'broadcastChannelId' => [
39
            'string',
40
        ],
41
        'broadcastFrequency' => [
42
            'string',
43
            BroadcastFrequencySpecification::class,
44
        ],
45
        'broadcastServiceTier' => [
46
            'string',
47
        ],
48
        'genre' => [
49
            'string',
50
        ],
51
        'inBroadcastLineup' => [
52
            Service\CableOrSatelliteService::class,
53
        ],
54
        'providesBroadcastService' => [
55
            Service\BroadcastService::class,
56
        ],
57
    ];
58
59
    /**
60
    * @return array<int, string>
61 5
    */
62
    public function GetBroadcastChannelId() : array
63
    {
64
        /**
65
        * @var array<int, string>
66 5
        */
67 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
68 5
            'broadcastChannelId',
69 5
            $this->RetrievePropertyValueFromData('broadcastChannelId'),
70
            static::class
71
        );
72 5
73
        return $out;
74
    }
75
76
    /**
77
    * @param array<int, string> $value
78 1
    */
79
    public function SetBroadcastChannelId(array $value) : void
80 1
    {
81 1
        $this->NudgePropertyValue(
82 1
            'broadcastChannelId',
83 1
            $value,
84
            true
85 1
        );
86
    }
87
88
    /**
89
    * @return array<int, string>
90 5
    */
91
    public function GetBroadcastServiceTier() : array
92
    {
93
        /**
94
        * @var array<int, string>
95 5
        */
96 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
97 5
            'broadcastServiceTier',
98 5
            $this->RetrievePropertyValueFromData('broadcastServiceTier'),
99
            static::class
100
        );
101 5
102
        return $out;
103
    }
104
105
    /**
106
    * @param array<int, string> $value
107 1
    */
108
    public function SetBroadcastServiceTier(array $value) : void
109 1
    {
110 1
        $this->NudgePropertyValue(
111 1
            'broadcastServiceTier',
112 1
            $value,
113
            true
114 1
        );
115
    }
116
117
    /**
118
    * @return array<int, Service\CableOrSatelliteService>
119 5
    */
120
    public function GetInBroadcastLineup() : array
121
    {
122
        /**
123
        * @var array<int, Service\CableOrSatelliteService>
124 5
        */
125 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
126 5
            'inBroadcastLineup',
127 5
            $this->RetrievePropertyValueFromData('inBroadcastLineup'),
128
            static::class
129
        );
130 5
131
        return $out;
132
    }
133
134
    /**
135
    * @param array<int, Service\CableOrSatelliteService> $value
136 1
    */
137
    public function SetInBroadcastLineup(array $value) : void
138 1
    {
139 1
        $this->NudgePropertyValue(
140 1
            'inBroadcastLineup',
141 1
            $value
142
        );
143 1
    }
144
145
    /**
146
    * @return array<int, Service\BroadcastService>
147
    */
148 5
    public function GetProvidesBroadcastService() : array
149
    {
150
        /**
151
        * @var array<int, Service\BroadcastService>
152
        */
153 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
154 5
            'providesBroadcastService',
155 5
            $this->RetrievePropertyValueFromData('providesBroadcastService'),
156 5
            static::class
157
        );
158
159 5
        return $out;
160
    }
161
162
    /**
163
    * @param array<int, Service\BroadcastService> $value
164
    */
165 1
    public function SetProvidesBroadcastService(array $value) : void
166
    {
167 1
        $this->NudgePropertyValue(
168 1
            'providesBroadcastService',
169 1
            $value
170
        );
171 1
    }
172
}
173