EntryPoint::SetActionApplication()   A
last analyzed

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\CreativeWork\SoftwareApplication;
10
use SignpostMarv\DaftObject\SchemaOrg\Intangible;
11
use SignpostMarv\DaftObject\SchemaOrg\Thing;
12
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
13
14
/**
15
* @property array<int, SoftwareApplication> $actionApplication
16
* @property array<int, string> $actionPlatform
17
* @property array<int, string> $contentType
18
* @property array<int, string> $encodingType
19
* @property array<int, string> $httpMethod
20
* @property array<int, string> $urlTemplate
21
*/
22
class EntryPoint extends Intangible
23
{
24
    const SCHEMA_ORG_TYPE = 'EntryPoint';
25
26
    const PROPERTIES = [
27
        'actionApplication',
28
        'actionPlatform',
29
        'contentType',
30
        'encodingType',
31
        'httpMethod',
32
        'urlTemplate',
33
    ];
34
35
    const PROPERTIES_WITH_MULTI_TYPED_ARRAYS = [
36
        'actionApplication' => [
37
            SoftwareApplication::class,
38
        ],
39
        'actionPlatform' => [
40
            'string',
41
        ],
42
        'contentType' => [
43
            'string',
44
        ],
45
        'encodingType' => [
46
            'string',
47
        ],
48
        'httpMethod' => [
49
            'string',
50
        ],
51
        'urlTemplate' => [
52
            'string',
53
        ],
54
    ];
55
56
    /**
57
    * @return array<int, SoftwareApplication>
58
    */
59 5
    public function GetActionApplication() : array
60
    {
61
        /**
62
        * @var array<int, SoftwareApplication>
63
        */
64 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
65 5
            'actionApplication',
66 5
            $this->RetrievePropertyValueFromData('actionApplication'),
67 5
            static::class
68
        );
69
70 5
        return $out;
71
    }
72
73
    /**
74
    * @param array<int, SoftwareApplication> $value
75
    */
76 1
    public function SetActionApplication(array $value) : void
77
    {
78 1
        $this->NudgePropertyValue(
79 1
            'actionApplication',
80 1
            $value
81
        );
82 1
    }
83
84
    /**
85
    * @return array<int, string>
86
    */
87 5
    public function GetActionPlatform() : array
88
    {
89
        /**
90
        * @var array<int, string>
91
        */
92 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
93 5
            'actionPlatform',
94 5
            $this->RetrievePropertyValueFromData('actionPlatform'),
95 5
            static::class
96
        );
97
98 5
        return $out;
99
    }
100
101
    /**
102
    * @param array<int, string> $value
103
    */
104 1
    public function SetActionPlatform(array $value) : void
105
    {
106 1
        $this->NudgePropertyValue(
107 1
            'actionPlatform',
108 1
            $value,
109 1
            Thing::BOOL_DEFAULT_AUTOTRIMSTRINGS
110
        );
111 1
    }
112
113
    /**
114
    * @return array<int, string>
115
    */
116 5
    public function GetContentType() : array
117
    {
118
        /**
119
        * @var array<int, string>
120
        */
121 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
122 5
            'contentType',
123 5
            $this->RetrievePropertyValueFromData('contentType'),
124 5
            static::class
125
        );
126
127 5
        return $out;
128
    }
129
130
    /**
131
    * @param array<int, string> $value
132
    */
133 1
    public function SetContentType(array $value) : void
134
    {
135 1
        $this->NudgePropertyValue(
136 1
            'contentType',
137 1
            $value,
138 1
            Thing::BOOL_DEFAULT_AUTOTRIMSTRINGS
139
        );
140 1
    }
141
142
    /**
143
    * @return array<int, string>
144
    */
145 5
    public function GetEncodingType() : array
146
    {
147
        /**
148
        * @var array<int, string>
149
        */
150 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
151 5
            'encodingType',
152 5
            $this->RetrievePropertyValueFromData('encodingType'),
153 5
            static::class
154
        );
155
156 5
        return $out;
157
    }
158
159
    /**
160
    * @param array<int, string> $value
161
    */
162 1
    public function SetEncodingType(array $value) : void
163
    {
164 1
        $this->NudgePropertyValue(
165 1
            'encodingType',
166 1
            $value,
167 1
            Thing::BOOL_DEFAULT_AUTOTRIMSTRINGS
168
        );
169 1
    }
170
171
    /**
172
    * @return array<int, string>
173
    */
174 5
    public function GetHttpMethod() : array
175
    {
176
        /**
177
        * @var array<int, string>
178
        */
179 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
180 5
            'httpMethod',
181 5
            $this->RetrievePropertyValueFromData('httpMethod'),
182 5
            static::class
183
        );
184
185 5
        return $out;
186
    }
187
188
    /**
189
    * @param array<int, string> $value
190
    */
191 1
    public function SetHttpMethod(array $value) : void
192
    {
193 1
        $this->NudgePropertyValue(
194 1
            'httpMethod',
195 1
            $value,
196 1
            Thing::BOOL_DEFAULT_AUTOTRIMSTRINGS
197
        );
198 1
    }
199
200
    /**
201
    * @return array<int, string>
202
    */
203 5
    public function GetUrlTemplate() : array
204
    {
205
        /**
206
        * @var array<int, string>
207
        */
208 5
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
209 5
            'urlTemplate',
210 5
            $this->RetrievePropertyValueFromData('urlTemplate'),
211 5
            static::class
212
        );
213
214 5
        return $out;
215
    }
216
217
    /**
218
    * @param array<int, string> $value
219
    */
220 1
    public function SetUrlTemplate(array $value) : void
221
    {
222 1
        $this->NudgePropertyValue(
223 1
            'urlTemplate',
224 1
            $value,
225 1
            Thing::BOOL_DEFAULT_AUTOTRIMSTRINGS
226
        );
227 1
    }
228
}
229