| Total Complexity | 4 |
| Total Lines | 73 |
| Duplicated Lines | 0 % |
| Coverage | 52.17% |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 |
||
| 82 | ); |
||
| 83 | } |
||
| 84 | } |
||
| 85 |