Passed
Branch fuzzy-generators (49fcec)
by SignpostMarv
08:30
created

GeoShape   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 133
Duplicated Lines 0 %

Test Coverage

Coverage 51.06%

Importance

Changes 0
Metric Value
eloc 51
dl 0
loc 133
ccs 24
cts 47
cp 0.5106
rs 10
c 0
b 0
f 0
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A SetCircle() 0 6 1
A SetPolygon() 0 6 1
A SetBox() 0 6 1
A SetLine() 0 6 1
A GetBox() 0 12 1
A GetPolygon() 0 12 1
A GetLine() 0 12 1
A GetCircle() 0 12 1
1
<?php
2
/**
3
* @author SignpostMarv
4
*/
5
declare(strict_types=1);
6
7
namespace SignpostMarv\DaftObject\SchemaOrg;
8
9
class GeoShape extends Thing
10
{
11
    use DaftObjectTraits\HasAddress;
12
    use DaftObjectTraits\HasAddressCountry;
13
    use DaftObjectTraits\HasElevation;
14
    use DaftObjectTraits\HasPostalCode;
15
16
    const SCHEMA_ORG_TYPE = 'GeoShape';
17
18
    const PROPERTIES = [
19
        'address',
20
        'addressCountry',
21
        'box',
22
        'circle',
23
        'elevation',
24
        'line',
25
        'polygon',
26
        'postalCode',
27
    ];
28
29
    /**
30
    * @return array<int, string>
31
    */
32 1
    public function GetBox() : array
33
    {
34
        /**
35
        * @var array<int, string>
36
        */
37 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
38 1
            'box',
39 1
            $this->RetrievePropertyValueFromData('box'),
40 1
            static::class
41
        );
42
43 1
        return $out;
44
    }
45
46
    /**
47
    * @param array<int, string> $value
48
    */
49
    public function SetBox(array $value) : void
50
    {
51
        $this->NudgePropertyWithUniqueTrimmedStringsMightNotBeString(
52
            'box',
53
            __METHOD__,
54
            $value
55
        );
56
    }
57
58
    /**
59
    * @return array<int, string>
60
    */
61 1
    public function GetCircle() : array
62
    {
63
        /**
64
        * @var array<int, string>
65
        */
66 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
67 1
            'circle',
68 1
            $this->RetrievePropertyValueFromData('circle'),
69 1
            static::class
70
        );
71
72 1
        return $out;
73
    }
74
75
    /**
76
    * @param array<int, string> $value
77
    */
78
    public function SetCircle(array $value) : void
79
    {
80
        $this->NudgePropertyWithUniqueTrimmedStringsMightNotBeString(
81
            'circle',
82
            __METHOD__,
83
            $value
84
        );
85
    }
86
87
    /**
88
    * @return array<int, string>
89
    */
90 1
    public function GetLine() : array
91
    {
92
        /**
93
        * @var array<int, string>
94
        */
95 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
96 1
            'line',
97 1
            $this->RetrievePropertyValueFromData('line'),
98 1
            static::class
99
        );
100
101 1
        return $out;
102
    }
103
104
    /**
105
    * @param array<int, string> $value
106
    */
107
    public function SetLine(array $value) : void
108
    {
109
        $this->NudgePropertyWithUniqueTrimmedStringsMightNotBeString(
110
            'line',
111
            __METHOD__,
112
            $value
113
        );
114
    }
115
116
    /**
117
    * @return array<int, string>
118
    */
119 1
    public function GetPolygon() : array
120
    {
121
        /**
122
        * @var array<int, string>
123
        */
124 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
125 1
            'polygon',
126 1
            $this->RetrievePropertyValueFromData('polygon'),
127 1
            static::class
128
        );
129
130 1
        return $out;
131
    }
132
133
    /**
134
    * @param array<int, string> $value
135
    */
136
    public function SetPolygon(array $value) : void
137
    {
138
        $this->NudgePropertyWithUniqueTrimmedStringsMightNotBeString(
139
            'polygon',
140
            __METHOD__,
141
            $value
142
        );
143
    }
144
}
145