| Total Complexity | 11 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | class Passing implements Interfaces\ICodecs |
||
| 17 | { |
||
| 18 | /** @var Interfaces\INumbers */ |
||
| 19 | protected $pos = null; |
||
| 20 | /** @var Interfaces\IFormatted */ |
||
| 21 | protected $out = null; |
||
| 22 | |||
| 23 | 8 | public function __construct(?Interfaces\INumbers $position = null, ?Interfaces\IFormatted $output = null) |
|
| 24 | { |
||
| 25 | 8 | $this->pos = $position ?: new Support\Position(); |
|
| 26 | 8 | $this->out = $output ?: new Support\DegreesObject(); |
|
| 27 | } |
||
| 28 | |||
| 29 | 4 | public function fromLonLat(Interfaces\INumbers $position): Interfaces\IFormatted |
|
| 30 | { |
||
| 31 | 4 | return (clone $this->out)->setData( |
|
| 32 | 4 | is_null($position->getLongitude()) ? null : strval($position->getLongitude()), |
|
|
|
|||
| 33 | 4 | is_null($position->getLatitude()) ? null : strval($position->getLatitude()), |
|
| 34 | 4 | is_null($position->getAltitude()) ? null : strval($position->getAltitude()), |
|
| 35 | ); |
||
| 36 | } |
||
| 37 | |||
| 38 | 4 | public function toLonLat(Interfaces\IFormatted $source): Interfaces\INumbers |
|
| 44 | ); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |