Passed
Push — master ( 3f960e...0dee84 )
by Swen
03:08 queued 12s
created
src/Adapter/GPX.php 1 patch
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     public function read(string $gpx, array $allowedElements = []): Geometry
69 69
     {
70 70
         // Converts XML tags to lower-case (DOMDocument functions are case sensitive)
71
-        $gpx = preg_replace_callback("/(<\/?\w+)(.*?>)/", function ($m) {
71
+        $gpx = preg_replace_callback("/(<\/?\w+)(.*?>)/", function($m) {
72 72
             return strtolower($m[1]) . $m[2];
73 73
         }, $gpx);
74 74
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         $lat = null;
163 163
         $lon = null;
164 164
         
165
-        if($node->attributes !== null) {
165
+        if ($node->attributes !== null) {
166 166
             $lat = $node->attributes->getNamedItem("lat")->nodeValue;
167 167
             $lon = $node->attributes->getNamedItem("lon")->nodeValue;
168 168
         }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         $point->setData($this->parseNodeProperties($node, $this->gpxTypes->get($node->nodeName . 'Type')));
179 179
         if ($node->nodeName === 'rtept' && $this->parseGarminRpt) {
180 180
             $rpts = $this->xpath->query('.//gpx:extensions/gpxx:RoutePointExtension/gpxx:rpt', $node);
181
-            if($rpts !== false) {
181
+            if ($rpts !== false) {
182 182
                 foreach ($rpts as $element) {
183 183
                     $this->trackFromRoute[] = $this->parsePoint($element);
184 184
                 }
@@ -227,14 +227,13 @@  discard block
 block discarded – undo
227 227
                     $points[] = $this->parsePoint($trkpt);
228 228
                 }
229 229
                 // Avoids creating invalid LineString
230
-                if (count($points)>1) {
230
+                if (count($points) > 1) {
231 231
                     $segments[] = new LineString($points);
232 232
                 }
233 233
             }
234 234
             if (!empty($segments)) {
235 235
                 $track = count($segments) === 1 ?
236
-                   $segments[0] :
237
-                   new MultiLineString($segments);
236
+                   $segments[0] : new MultiLineString($segments);
238 237
                 $track->setData($this->parseNodeProperties($trk, $this->gpxTypes->get('trkType')));
239 238
                 $track->setData('gpxType', 'track');
240 239
                 $tracks[] = $track;
@@ -451,7 +450,7 @@  discard block
 block discarded – undo
451 450
     {
452 451
         $metadata = self::processGeometryData($geometry, $this->gpxTypes->get('metadataType'));
453 452
         $metadata = empty($metadata) || !in_array('metadataType', $this->gpxTypes->get('gpxType')) ?
454
-            '' : "<metadata>\n" . $metadata. "</metadata>\n\n";
453
+            '' : "<metadata>\n" . $metadata . "</metadata>\n\n";
455 454
         $wayPoints = $routes = $tracks = "";
456 455
 
457 456
         foreach ($geometry->getComponents() as $component) {
Please login to merge, or discard this patch.