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

GeoCoordinates::GetLatitude()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 12
ccs 6
cts 6
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
class GeoCoordinates 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 = 'GeoCoordinates';
17
18
    const PROPERTIES = [
19
        'address',
20
        'addressCountry',
21
        'elevation',
22
        'latitude',
23
        'longitude',
24
        'postalCode',
25
    ];
26
27
    /**
28
    * @return array<int, string|float|int>
29
    */
30 1
    public function GetLatitude() : array
31
    {
32
        /**
33
        * @var array<int, string|float|int>
34
        */
35 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
36 1
            'latitude',
37 1
            $this->RetrievePropertyValueFromData('latitude'),
38 1
            static::class
39
        );
40
41 1
        return $out;
42
    }
43
44
    /**
45
    * @param array<int, string|float|int> $value
46
    */
47
    public function SetLatitude(array $value) : void
48
    {
49
        $this->NudgePropertyWithUniqueTrimmedStringsNumericsMightNotBeStringsOrNumerics(
50
            'latitude',
51
            __METHOD__,
52
            $value
53
        );
54
    }
55
56
    /**
57
    * @return array<int, string|float|int>
58
    */
59 1
    public function GetLongitude() : array
60
    {
61
        /**
62
        * @var array<int, string|float|int>
63
        */
64 1
        $out = TypeUtilities::ExpectRetrievedValueIsArray(
65 1
            'longitude',
66 1
            $this->RetrievePropertyValueFromData('longitude'),
67 1
            static::class
68
        );
69
70 1
        return $out;
71
    }
72
73
    /**
74
    * @param array<int, string|float|int> $value
75
    */
76
    public function SetLongitude(array $value) : void
77
    {
78
        $this->NudgePropertyWithUniqueTrimmedStringsNumericsMightNotBeStringsOrNumerics(
79
            'longitude',
80
            __METHOD__,
81
            $value
82
        );
83
    }
84
}
85