Passed
Push — master ( f71194...439e24 )
by SignpostMarv
11:18
created

HasGeospatialGeometry::SetGeospatiallyCovers()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 0
loc 8
ccs 7
cts 7
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\DaftObjectTraits;
8
9
use SignpostMarv\DaftObject\SchemaOrg\Intangible\GeospatialGeometry;
10
use SignpostMarv\DaftObject\SchemaOrg\Place;
11
use SignpostMarv\DaftObject\SchemaOrg\TypeUtilities;
12
13
trait HasGeospatialGeometry
14
{
15
    use DaftObjectTrait;
16
17
    /**
18
    * @return array<int, GeospatialGeometry|Place>
19
    */
20 72
    public function GetGeospatiallyContains() : array
21
    {
22
        /**
23
        * @var array<int, GeospatialGeometry|Place>
24
        */
25 72
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
26 72
            'geospatiallyContains',
27 72
            $this->RetrievePropertyValueFromData('geospatiallyContains'),
0 ignored issues
show
Bug introduced by
It seems like RetrievePropertyValueFromData() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
            $this->/** @scrutinizer ignore-call */ 
28
                   RetrievePropertyValueFromData('geospatiallyContains'),
Loading history...
28 72
            static::class
29
        );
30
31 72
        return $out;
32
    }
33
34
    /**
35
    * @param array<int, GeospatialGeometry|Place> $value
36
    */
37 3
    public function SetGeospatiallyContains(array $value) : void
38
    {
39 3
        $this->NudgePropertyWithUniqueValuesOfThings(
40 3
            'geospatiallyContains',
41 3
            __METHOD__,
42 3
            $value,
43 3
            GeospatialGeometry::class,
44 3
            Place::class
45
        );
46 3
    }
47
48
    /**
49
    * @return array<int, GeospatialGeometry|Place>
50
    */
51 72
    public function GetGeospatiallyCoveredBy() : array
52
    {
53
        /**
54
        * @var array<int, GeospatialGeometry|Place>
55
        */
56 72
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
57 72
            'geospatiallyCoveredBy',
58 72
            $this->RetrievePropertyValueFromData('geospatiallyCoveredBy'),
59 72
            static::class
60
        );
61
62 72
        return $out;
63
    }
64
65
    /**
66
    * @param array<int, GeospatialGeometry|Place> $value
67
    */
68 3
    public function SetGeospatiallyCoveredBy(array $value) : void
69
    {
70 3
        $this->NudgePropertyWithUniqueValuesOfThings(
71 3
            'geospatiallyCoveredBy',
72 3
            __METHOD__,
73 3
            $value,
74 3
            GeospatialGeometry::class,
75 3
            Place::class
76
        );
77 3
    }
78
79
    /**
80
    * @return array<int, GeospatialGeometry|Place>
81
    */
82 72
    public function GetGeospatiallyCovers() : array
83
    {
84
        /**
85
        * @var array<int, GeospatialGeometry|Place>
86
        */
87 72
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
88 72
            'geospatiallyCovers',
89 72
            $this->RetrievePropertyValueFromData('geospatiallyCovers'),
90 72
            static::class
91
        );
92
93 72
        return $out;
94
    }
95
96
    /**
97
    * @param array<int, GeospatialGeometry|Place> $value
98
    */
99 3
    public function SetGeospatiallyCovers(array $value) : void
100
    {
101 3
        $this->NudgePropertyWithUniqueValuesOfThings(
102 3
            'geospatiallyCovers',
103 3
            __METHOD__,
104 3
            $value,
105 3
            GeospatialGeometry::class,
106 3
            Place::class
107
        );
108 3
    }
109
110
    /**
111
    * @return array<int, GeospatialGeometry|Place>
112
    */
113 72
    public function GetGeospatiallyCrosses() : array
114
    {
115
        /**
116
        * @var array<int, GeospatialGeometry|Place>
117
        */
118 72
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
119 72
            'geospatiallyCrosses',
120 72
            $this->RetrievePropertyValueFromData('geospatiallyCrosses'),
121 72
            static::class
122
        );
123
124 72
        return $out;
125
    }
126
127
    /**
128
    * @param array<int, GeospatialGeometry|Place> $value
129
    */
130 3
    public function SetGeospatiallyCrosses(array $value) : void
131
    {
132 3
        $this->NudgePropertyWithUniqueValuesOfThings(
133 3
            'geospatiallyCrosses',
134 3
            __METHOD__,
135 3
            $value,
136 3
            GeospatialGeometry::class,
137 3
            Place::class
138
        );
139 3
    }
140
141
    /**
142
    * @return array<int, GeospatialGeometry|Place>
143
    */
144 72
    public function GetGeospatiallyDisjoint() : array
145
    {
146
        /**
147
        * @var array<int, GeospatialGeometry|Place>
148
        */
149 72
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
150 72
            'geospatiallyDisjoint',
151 72
            $this->RetrievePropertyValueFromData('geospatiallyDisjoint'),
152 72
            static::class
153
        );
154
155 72
        return $out;
156
    }
157
158
    /**
159
    * @param array<int, GeospatialGeometry|Place> $value
160
    */
161 3
    public function SetGeospatiallyDisjoint(array $value) : void
162
    {
163 3
        $this->NudgePropertyWithUniqueValuesOfThings(
164 3
            'geospatiallyDisjoint',
165 3
            __METHOD__,
166 3
            $value,
167 3
            GeospatialGeometry::class,
168 3
            Place::class
169
        );
170 3
    }
171
172
    /**
173
    * @return array<int, GeospatialGeometry|Place>
174
    */
175 72
    public function GetGeospatiallyEquals() : array
176
    {
177
        /**
178
        * @var array<int, GeospatialGeometry|Place>
179
        */
180 72
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
181 72
            'geospatiallyEquals',
182 72
            $this->RetrievePropertyValueFromData('geospatiallyEquals'),
183 72
            static::class
184
        );
185
186 72
        return $out;
187
    }
188
189
    /**
190
    * @param array<int, GeospatialGeometry|Place> $value
191
    */
192 3
    public function SetGeospatiallyEquals(array $value) : void
193
    {
194 3
        $this->NudgePropertyWithUniqueValuesOfThings(
195 3
            'geospatiallyEquals',
196 3
            __METHOD__,
197 3
            $value,
198 3
            GeospatialGeometry::class,
199 3
            Place::class
200
        );
201 3
    }
202
203
    /**
204
    * @return array<int, GeospatialGeometry|Place>
205
    */
206 72
    public function GetGeospatiallyIntersects() : array
207
    {
208
        /**
209
        * @var array<int, GeospatialGeometry|Place>
210
        */
211 72
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
212 72
            'geospatiallyIntersects',
213 72
            $this->RetrievePropertyValueFromData('geospatiallyIntersects'),
214 72
            static::class
215
        );
216
217 72
        return $out;
218
    }
219
220
    /**
221
    * @param array<int, GeospatialGeometry|Place> $value
222
    */
223 3
    public function SetGeospatiallyIntersects(array $value) : void
224
    {
225 3
        $this->NudgePropertyWithUniqueValuesOfThings(
226 3
            'geospatiallyIntersects',
227 3
            __METHOD__,
228 3
            $value,
229 3
            GeospatialGeometry::class,
230 3
            Place::class
231
        );
232 3
    }
233
234
    /**
235
    * @return array<int, GeospatialGeometry|Place>
236
    */
237 72
    public function GetGeospatiallyOverlaps() : array
238
    {
239
        /**
240
        * @var array<int, GeospatialGeometry|Place>
241
        */
242 72
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
243 72
            'geospatiallyOverlaps',
244 72
            $this->RetrievePropertyValueFromData('geospatiallyOverlaps'),
245 72
            static::class
246
        );
247
248 72
        return $out;
249
    }
250
251
    /**
252
    * @param array<int, GeospatialGeometry|Place> $value
253
    */
254 3
    public function SetGeospatiallyOverlaps(array $value) : void
255
    {
256 3
        $this->NudgePropertyWithUniqueValuesOfThings(
257 3
            'geospatiallyOverlaps',
258 3
            __METHOD__,
259 3
            $value,
260 3
            GeospatialGeometry::class,
261 3
            Place::class
262
        );
263 3
    }
264
265
    /**
266
    * @return array<int, GeospatialGeometry|Place>
267
    */
268 72
    public function GetGeospatiallyTouches() : array
269
    {
270
        /**
271
        * @var array<int, GeospatialGeometry|Place>
272
        */
273 72
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
274 72
            'geospatiallyTouches',
275 72
            $this->RetrievePropertyValueFromData('geospatiallyTouches'),
276 72
            static::class
277
        );
278
279 72
        return $out;
280
    }
281
282
    /**
283
    * @param array<int, GeospatialGeometry|Place> $value
284
    */
285 3
    public function SetGeospatiallyTouches(array $value) : void
286
    {
287 3
        $this->NudgePropertyWithUniqueValuesOfThings(
288 3
            'geospatiallyTouches',
289 3
            __METHOD__,
290 3
            $value,
291 3
            GeospatialGeometry::class,
292 3
            Place::class
293
        );
294 3
    }
295
296
    /**
297
    * @return array<int, GeospatialGeometry|Place>
298
    */
299 72
    public function GetGeospatiallyWithin() : array
300
    {
301
        /**
302
        * @var array<int, GeospatialGeometry|Place>
303
        */
304 72
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
305 72
            'geospatiallyWithin',
306 72
            $this->RetrievePropertyValueFromData('geospatiallyWithin'),
307 72
            static::class
308
        );
309
310 72
        return $out;
311
    }
312
313
    /**
314
    * @param array<int, GeospatialGeometry|Place> $value
315
    */
316 3
    public function SetGeospatiallyWithin(array $value) : void
317
    {
318 3
        $this->NudgePropertyWithUniqueValuesOfThings(
319 3
            'geospatiallyWithin',
320 3
            __METHOD__,
321 3
            $value,
322 3
            GeospatialGeometry::class,
323 3
            Place::class
324
        );
325 3
    }
326
}
327