Action::GetResult()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 8
ccs 3
cts 3
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;
8
9
use SignpostMarv\DaftObject\SchemaOrg\DataTypes\DateTime;
10
use SignpostMarv\DaftObject\SchemaOrg\Intangible\EntryPoint;
11
use SignpostMarv\DaftObject\SchemaOrg\Intangible\Enumeration\ActionStatusType;
12
use SignpostMarv\DaftObject\SchemaOrg\Intangible\StructuredValue\ContactPoint\PostalAddress;
13
14
/**
15
* @property array<int, ActionStatusType> $actionStatus
16
* @property array<int, Organization|Person> $agent
17
* @property array<int, DateTime> $endTime
18
* @property array<int, Thing> $error
19
* @property array<int, Thing> $instrument
20
* @property array<int, string|Place|PostalAddress> $location
21
* @property array<int, Thing> $object
22
* @property array<int, Organization|Person> $participant
23
* @property array<int, Thing> $result
24
* @property array<int, DateTime> $startTime
25
* @property array<int, EntryPoint> $target
26
*/
27
class Action extends Thing
28
{
29
    use DaftObjectTraits\HasLocation;
30
31
    const SCHEMA_ORG_TYPE = 'Action';
32
33
    const PROPERTIES = [
34
        'actionStatus',
35
        'agent',
36
        'endTime',
37
        'error',
38
        'instrument',
39
        'location',
40
        'object',
41
        'participant',
42
        'result',
43
        'startTime',
44
        'target',
45
    ];
46
47
    const PROPERTIES_WITH_MULTI_TYPED_ARRAYS = [
48
        'actionStatus' => [
49
            ActionStatusType::class,
50
        ],
51
        'agent' => [
52
            Organization::class,
53
            Person::class,
54
        ],
55
        'endTime' => [
56
            DateTime::class,
57
        ],
58
        'error' => [
59
            Thing::class,
60
        ],
61
        'instrument' => [
62
            Thing::class,
63
        ],
64
        'location' => [
65
            'string',
66
            Place::class,
67
            PostalAddress::class,
68
        ],
69
        'object' => [
70
            Thing::class,
71
        ],
72
        'participant' => [
73
            Organization::class,
74
            Person::class,
75
        ],
76
        'result' => [
77
            Thing::class,
78
        ],
79
        'startTime' => [
80
            DateTime::class,
81
        ],
82
        'target' => [
83
            EntryPoint::class,
84
        ],
85
    ];
86
87
    /**
88
    * @return array<int, ActionStatusType>
89
    */
90 112
    public function GetActionStatus() : array
91
    {
92
        /**
93
        * @var array<int, ActionStatusType>
94
        */
95 112
        $out = $this->ExpectRetrievedValueIsArray('actionStatus');
96
97 112
        return $out;
98
    }
99
100
    /**
101
    * @param array<int, ActionStatusType> $value
102
    */
103 1
    public function SetActionStatus(array $value) : void
104
    {
105 1
        $this->NudgePropertyValue('actionStatus', $value);
106 1
    }
107
108
    /**
109
    * @return array<int, Organization|Person>
110
    */
111 112
    public function GetAgent() : array
112
    {
113
        /**
114
        * @var array<int, Organization|Person>
115
        */
116 112
        $out = $this->ExpectRetrievedValueIsArray('agent');
117
118 112
        return $out;
119
    }
120
121
    /**
122
    * @param array<int, Organization|Person> $value
123
    */
124 1
    public function SetAgent(array $value) : void
125
    {
126 1
        $this->NudgePropertyValue('agent', $value);
127 1
    }
128
129
    /**
130
    * @return array<int, DateTime>
131
    */
132 112
    public function GetEndTime() : array
133
    {
134
        /**
135
        * @var array<int, DateTime>
136
        */
137 112
        $out = $this->ExpectRetrievedValueIsArray('endTime');
138
139 112
        return $out;
140
    }
141
142
    /**
143
    * @param array<int, DateTime> $value
144
    */
145 1
    public function SetEndTime(array $value) : void
146
    {
147 1
        $this->NudgePropertyValue('endTime', $value);
148 1
    }
149
150
    /**
151
    * @return array<int, Thing>
152
    */
153 112
    public function GetError() : array
154
    {
155
        /**
156
        * @var array<int, Thing>
157
        */
158 112
        $out = $this->ExpectRetrievedValueIsArray('error');
159
160 112
        return $out;
161
    }
162
163
    /**
164
    * @param array<int, Thing> $value
165
    */
166 1
    public function SetError(array $value) : void
167
    {
168 1
        $this->NudgePropertyValue('error', $value);
169 1
    }
170
171
    /**
172
    * @return array<int, Thing>
173
    */
174 112
    public function GetInstrument() : array
175
    {
176
        /**
177
        * @var array<int, Thing>
178
        */
179 112
        $out = $this->ExpectRetrievedValueIsArray('instrument');
180
181 112
        return $out;
182
    }
183
184
    /**
185
    * @param array<int, Thing> $value
186
    */
187 1
    public function SetInstrument(array $value) : void
188
    {
189 1
        $this->NudgePropertyValue('instrument', $value);
190 1
    }
191
192
    /**
193
    * @return array<int, Thing>
194
    */
195 112
    public function GetObject() : array
196
    {
197
        /**
198
        * @var array<int, Thing>
199
        */
200 112
        $out = $this->ExpectRetrievedValueIsArray('object');
201
202 112
        return $out;
203
    }
204
205
    /**
206
    * @param array<int, Thing> $value
207
    */
208 1
    public function SetObject(array $value) : void
209
    {
210 1
        $this->NudgePropertyValue('object', $value);
211 1
    }
212
213
    /**
214
    * @return array<int, Organization|Person>
215
    */
216 112
    public function GetParticipant() : array
217
    {
218
        /**
219
        * @var array<int, Organization|Person>
220
        */
221 112
        $out = $this->ExpectRetrievedValueIsArray('participant');
222
223 112
        return $out;
224
    }
225
226
    /**
227
    * @param array<int, Organization|Person> $value
228
    */
229 1
    public function SetParticipant(array $value) : void
230
    {
231 1
        $this->NudgePropertyValue('participant', $value);
232 1
    }
233
234
    /**
235
    * @return array<int, Thing>
236
    */
237 112
    public function GetResult() : array
238
    {
239
        /**
240
        * @var array<int, Thing>
241
        */
242 112
        $out = $this->ExpectRetrievedValueIsArray('result');
243
244 112
        return $out;
245
    }
246
247
    /**
248
    * @param array<int, Thing> $value
249
    */
250 1
    public function SetResult(array $value) : void
251
    {
252 1
        $this->NudgePropertyValue('result', $value);
253 1
    }
254
255
    /**
256
    * @return array<int, DateTime>
257
    */
258 112
    public function GetStartTime() : array
259
    {
260
        /**
261
        * @var array<int, DateTime>
262
        */
263 112
        $out = $this->ExpectRetrievedValueIsArray('startTime');
264
265 112
        return $out;
266
    }
267
268
    /**
269
    * @param array<int, DateTime> $value
270
    */
271 1
    public function SetStartTime(array $value) : void
272
    {
273 1
        $this->NudgePropertyValue('startTime', $value);
274 1
    }
275
276
    /**
277
    * @return array<int, EntryPoint>
278
    */
279 112
    public function GetTarget() : array
280
    {
281
        /**
282
        * @var array<int, EntryPoint>
283
        */
284 112
        $out = $this->ExpectRetrievedValueIsArray('target');
285
286 112
        return $out;
287
    }
288
289
    /**
290
    * @param array<int, EntryPoint> $value
291
    */
292 1
    public function SetTarget(array $value) : void
293
    {
294 1
        $this->NudgePropertyValue('target', $value);
295 1
    }
296
}
297