@@ -35,7 +35,9 @@ discard block |
||
35 | 35 | $result = $lib->fromLonLat($transport->setData($coordLon, $coordLat, $useAlt ? $coordAlt : 0.0), $params); |
36 | 36 | $this->assertEquals(sprintf('%01.6f', $x), sprintf('%01.6f', $result->getLongitude())); |
37 | 37 | $this->assertEquals(sprintf('%01.6f', $y), sprintf('%01.6f', $result->getLatitude())); |
38 | - if ($useAlt) $this->assertEquals(sprintf('%01.6f', $z), sprintf('%01.6f', $result->getAltitude())); |
|
38 | + if ($useAlt) { |
|
39 | + $this->assertEquals(sprintf('%01.6f', $z), sprintf('%01.6f', $result->getAltitude())); |
|
40 | + } |
|
39 | 41 | } |
40 | 42 | |
41 | 43 | public function transferFromProvider(): array |
@@ -66,7 +68,9 @@ discard block |
||
66 | 68 | $result = $lib->toLonLat($transport->setData($x, $y, $useAlt ? $z : 0.0), $params); |
67 | 69 | $this->assertEquals(sprintf('%01.6f', $coordLon), sprintf('%01.6f', $result->getLongitude())); |
68 | 70 | $this->assertEquals(sprintf('%01.6f', $coordLat), sprintf('%01.6f', $result->getLatitude())); |
69 | - if ($useAlt) $this->assertEquals(sprintf('%01.6f', $coordAlt), sprintf('%01.6f', $result->getAltitude())); |
|
71 | + if ($useAlt) { |
|
72 | + $this->assertEquals(sprintf('%01.6f', $coordAlt), sprintf('%01.6f', $result->getAltitude())); |
|
73 | + } |
|
70 | 74 | } |
71 | 75 | |
72 | 76 | public function transferToProvider(): array |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public function toLonLat(Interfaces\IFormatted $source, array $params): Interfaces\INumbers |
57 | 57 | { |
58 | 58 | return (clone $this->pos)->setData( |
59 | - $this->fromDegrees(strval($source->getLongitude()),360, 180, 'W', 'E'), |
|
59 | + $this->fromDegrees(strval($source->getLongitude()), 360, 180, 'W', 'E'), |
|
60 | 60 | $this->fromDegrees(strval($source->getLatitude()), 180, 90, 'S', 'N'), |
61 | 61 | floatval(strval($source->getAltitude())) |
62 | 62 | ); |
@@ -99,6 +99,6 @@ discard block |
||
99 | 99 | |
100 | 100 | protected function plusMinus(string $input, string $forNegative, string $forPositive): float |
101 | 101 | { |
102 | - return (false !== strpos($input, $forNegative)) ? -1 : 1 ; |
|
102 | + return (false !== strpos($input, $forNegative)) ? -1 : 1; |
|
103 | 103 | } |
104 | 104 | } |