Total Complexity | 7 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class Position implements INumbers |
||
15 | { |
||
16 | /** @var float X +-180° */ |
||
17 | protected float $longitude = 0.0; |
||
18 | /** @var float Y +-90° */ |
||
19 | protected float $latitude = 0.0; |
||
20 | /** @var float Z +-10000m */ |
||
21 | protected float $altitude = 0.0; |
||
22 | |||
23 | 20 | public function setData(?float $longitude = 0.0, ?float $latitude = 0.0, ?float $altitude = 0.0): INumbers |
|
24 | { |
||
25 | 20 | $this->longitude = is_null($longitude) ? $this->longitude : $longitude; |
|
26 | 20 | $this->latitude = is_null($latitude) ? $this->latitude : $latitude; |
|
27 | 20 | $this->altitude = is_null($altitude) ? $this->altitude : $altitude; |
|
28 | 20 | return $this; |
|
29 | } |
||
30 | |||
31 | 20 | public function getLongitude(): float |
|
34 | } |
||
35 | |||
36 | 20 | public function getLatitude(): float |
|
39 | } |
||
40 | |||
41 | 14 | public function getAltitude(): float |
|
46 |