Completed
Push — master ( 3e13e1...ba9fdc )
by Mark
17s queued 13s
created
icons/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@
 block discarded – undo
42 42
 </head>
43 43
 <body>
44 44
 <div class="box"><?php
45
-    foreach(glob('*.png') as $img) {
46
-        echo '<img src="' . $img . '" alt="' . $img . '" title="' . $img . '" /> ';
45
+    foreach (glob('*.png') as $img) {
46
+        echo '<img src="'.$img.'" alt="'.$img.'" title="'.$img.'" /> ';
47 47
     }
48 48
     ?></div>
49 49
 </body>
Please login to merge, or discard this patch.
helper/staticmap.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -80,17 +80,17 @@  discard block
 block discarded – undo
80 80
 
81 81
         // normalize zoom
82 82
         $zoom = $zoom ?: 0;
83
-        if($zoom > 18) {
83
+        if ($zoom > 18) {
84 84
             $zoom = 18;
85 85
         }
86 86
         // normalize WxH
87 87
         list($width, $height) = explode('x', $size);
88 88
         $width = (int) $width;
89
-        if($width > $this->maxWidth) {
89
+        if ($width > $this->maxWidth) {
90 90
             $width = $this->maxWidth;
91 91
         }
92 92
         $height = (int) $height;
93
-        if($height > $this->maxHeight) {
93
+        if ($height > $this->maxHeight) {
94 94
             $height = $this->maxHeight;
95 95
         }
96 96
 
@@ -125,14 +125,14 @@  discard block
 block discarded – undo
125 125
      */
126 126
     private function mediaIdToPath(string $id): string {
127 127
         global $conf;
128
-        if(empty($id)) {
128
+        if (empty($id)) {
129 129
             return "";
130 130
         }
131 131
         $id = str_replace(array("[[", "]]"), "", $id);
132
-        if((strpos($id, ':') === 0)) {
132
+        if ((strpos($id, ':') === 0)) {
133 133
             $id = substr($id, 1);
134 134
         }
135 135
         $id = str_replace(":", "/", $id);
136
-        return $conf['mediadir'] . '/' . $id;
136
+        return $conf['mediadir'].'/'.$id;
137 137
     }
138 138
 }
Please login to merge, or discard this patch.
_test/general.test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
      * Simple test to make sure the plugin.info.txt is in correct format.
31 31
      */
32 32
     final public function test_plugininfo(): void {
33
-        $file = __DIR__ . '/../plugin.info.txt';
33
+        $file = __DIR__.'/../plugin.info.txt';
34 34
         self::assertFileExists($file);
35 35
 
36 36
         $info = confToHash($file);
Please login to merge, or discard this patch.
admin/purge.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
     public function getMenuIcon(): string {
36 36
         $plugin = $this->getPluginName();
37
-        return DOKU_PLUGIN . $plugin . '/admin/purge.svg';
37
+        return DOKU_PLUGIN.$plugin.'/admin/purge.svg';
38 38
     }
39 39
 
40 40
     /**
@@ -43,18 +43,18 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function handle(): void {
45 45
         global $conf;
46
-        if(!isset($_REQUEST['continue']) || !checkSecurityToken()) {
46
+        if (!isset($_REQUEST['continue']) || !checkSecurityToken()) {
47 47
             return;
48 48
         }
49
-        if(isset($_REQUEST['purgetiles'])) {
50
-            $path = $conf['cachedir'] . '/olmaptiles';
51
-            if($this->rrmdir($path)) {
49
+        if (isset($_REQUEST['purgetiles'])) {
50
+            $path = $conf['cachedir'].'/olmaptiles';
51
+            if ($this->rrmdir($path)) {
52 52
                 msg($this->getLang('admin_purged_tiles'), 0);
53 53
             }
54 54
         }
55
-        if(isset($_REQUEST['purgemaps'])) {
56
-            $path = $conf['mediadir'] . '/olmapmaps';
57
-            if($this->rrmdir($path)) {
55
+        if (isset($_REQUEST['purgemaps'])) {
56
+            $path = $conf['mediadir'].'/olmapmaps';
57
+            if ($this->rrmdir($path)) {
58 58
                 msg($this->getLang('admin_purged_maps'), 0);
59 59
             }
60 60
         }
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
      * @return boolean true when succesful
67 67
      */
68 68
     private function rrmdir(string $sDir): bool {
69
-        if(is_dir($sDir)) {
69
+        if (is_dir($sDir)) {
70 70
             dbglog($sDir, 'admin_plugin_openlayersmap_purge::rrmdir: recursively removing path: ');
71 71
             $sDir = rtrim($sDir, '/');
72 72
             $oDir = dir($sDir);
73
-            while(($sFile = $oDir->read()) !== false) {
74
-                if($sFile !== '.' && $sFile !== '..') {
73
+            while (($sFile = $oDir->read()) !== false) {
74
+                if ($sFile !== '.' && $sFile !== '..') {
75 75
                     (!is_link("$sDir/$sFile") && is_dir("$sDir/$sFile")) ?
76 76
                         $this->rrmdir("$sDir/$sFile") : unlink("$sDir/$sFile");
77 77
                 }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             '<input id="purgetiles" name="purgetiles" type="checkbox" value="1" class="checkbox" />'
99 99
         );
100 100
         $form->addElement(
101
-            '<label for="purgetiles" class="label">' . $this->getLang('admin_purge_tiles')
101
+            '<label for="purgetiles" class="label">'.$this->getLang('admin_purge_tiles')
102 102
             . '</label>'
103 103
         );
104 104
         $form->addElement('</p>');
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         $form->addElement('<p>');
109 109
         $form->addElement('<input id="purgemaps" name="purgemaps" type="checkbox" value="1" class="checkbox" />');
110 110
         $form->addElement(
111
-            '<label for="purgemaps" class="label">' . $this->getLang('admin_purge_maps') . '</label>'
111
+            '<label for="purgemaps" class="label">'.$this->getLang('admin_purge_maps').'</label>'
112 112
         );
113 113
         $form->addElement('</p>');
114 114
         $form->endFieldset();
Please login to merge, or discard this patch.
action.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
      * @param Doku_Event $event the DokuWiki event
40 40
      */
41 41
     public function insertButton(Doku_Event $event, $param) {
42
-        $strOpen       = '<olmap id="olMapOne" width="550px" height="450px" lat="50.0" ';
42
+        $strOpen = '<olmap id="olMapOne" width="550px" height="450px" lat="50.0" ';
43 43
         $strOpen       .= 'lon="5.1" zoom="12" controls="1" ';
44 44
         $strOpen       .= 'baselyr="OpenStreetMap" gpxfile="" kmlfile="" geojsonfile="" summary="" >\n';
45 45
         $strOpen       .= '~~ Plugin olmap help.\n';
Please login to merge, or discard this patch.
StaticMap.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -331,17 +331,17 @@
 block discarded – undo
331 331
     public function serializeParams(): string {
332 332
         return implode(
333 333
             "&", array(
334
-                   $this->zoom,
335
-                   $this->lat,
336
-                   $this->lon,
337
-                   $this->width,
338
-                   $this->height,
339
-                   serialize($this->markers),
340
-                   $this->maptype,
341
-                   $this->kmlFileName,
342
-                   $this->gpxFileName,
343
-                   $this->geojsonFileName
344
-               )
334
+                    $this->zoom,
335
+                    $this->lat,
336
+                    $this->lon,
337
+                    $this->width,
338
+                    $this->height,
339
+                    serialize($this->markers),
340
+                    $this->maptype,
341
+                    $this->kmlFileName,
342
+                    $this->gpxFileName,
343
+                    $this->geojsonFileName
344
+                )
345 345
         );
346 346
     }
347 347
 
Please login to merge, or discard this patch.
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         $this->height = $height;
215 215
         // validate + set maptype
216 216
         $this->maptype = $this->tileDefaultSrc;
217
-        if(array_key_exists($maptype, $this->tileInfo)) {
217
+        if (array_key_exists($maptype, $this->tileInfo)) {
218 218
             $this->maptype = $maptype;
219 219
         }
220 220
         $this->markers          = $markers;
@@ -222,9 +222,9 @@  discard block
 block discarded – undo
222 222
         $this->gpxFileName      = $gpx;
223 223
         $this->geojsonFileName  = $geojson;
224 224
         $this->mediaBaseDir     = $mediaDir;
225
-        $this->tileCacheBaseDir = $tileCacheBaseDir . '/olmaptiles';
225
+        $this->tileCacheBaseDir = $tileCacheBaseDir.'/olmaptiles';
226 226
         $this->useTileCache     = $this->tileCacheBaseDir !== '';
227
-        $this->mapCacheBaseDir  = $mediaDir . '/olmapmaps';
227
+        $this->mapCacheBaseDir  = $mediaDir.'/olmapmaps';
228 228
         $this->autoZoomExtent   = $autoZoomExtent;
229 229
         $this->apikey           = $apikey;
230 230
     }
@@ -236,15 +236,15 @@  discard block
 block discarded – undo
236 236
      */
237 237
     public function getMap(): string {
238 238
         try {
239
-            if($this->autoZoomExtent) {
239
+            if ($this->autoZoomExtent) {
240 240
                 $this->autoZoom();
241 241
             }
242
-        } catch(Exception $e) {
242
+        } catch (Exception $e) {
243 243
             dbglog($e);
244 244
         }
245 245
 
246 246
         // use map cache, so check cache for map
247
-        if(!$this->checkMapCache()) {
247
+        if (!$this->checkMapCache()) {
248 248
             // map is not in cache, needs to be build
249 249
             $this->makeMap();
250 250
             $this->mkdirRecursive(dirname($this->mapCacheIDToFilename()), 0777);
@@ -264,37 +264,37 @@  discard block
 block discarded – undo
264 264
      */
265 265
     private function autoZoom(float $paddingFactor = 1.0): void {
266 266
         $geoms    = array();
267
-        $geoms [] = new Point ($this->lon, $this->lat);
268
-        if(!empty ($this->markers)) {
269
-            foreach($this->markers as $marker) {
270
-                $geoms [] = new Point ($marker ['lon'], $marker ['lat']);
267
+        $geoms [] = new Point($this->lon, $this->lat);
268
+        if (!empty ($this->markers)) {
269
+            foreach ($this->markers as $marker) {
270
+                $geoms [] = new Point($marker ['lon'], $marker ['lat']);
271 271
             }
272 272
         }
273
-        if(file_exists($this->kmlFileName)) {
273
+        if (file_exists($this->kmlFileName)) {
274 274
             $g = geoPHP::load(file_get_contents($this->kmlFileName), 'kml');
275
-            if($g !== false) {
275
+            if ($g !== false) {
276 276
                 $geoms [] = $g;
277 277
             }
278 278
         }
279
-        if(file_exists($this->gpxFileName)) {
279
+        if (file_exists($this->gpxFileName)) {
280 280
             $g = geoPHP::load(file_get_contents($this->gpxFileName), 'gpx');
281
-            if($g !== false) {
281
+            if ($g !== false) {
282 282
                 $geoms [] = $g;
283 283
             }
284 284
         }
285
-        if(file_exists($this->geojsonFileName)) {
285
+        if (file_exists($this->geojsonFileName)) {
286 286
             $g = geoPHP::load(file_get_contents($this->geojsonFileName), 'geojson');
287
-            if($g !== false) {
287
+            if ($g !== false) {
288 288
                 $geoms [] = $g;
289 289
             }
290 290
         }
291 291
 
292
-        if(count($geoms) <= 1) {
292
+        if (count($geoms) <= 1) {
293 293
             dbglog($geoms, "StaticMap::autoZoom: Skip setting autozoom options");
294 294
             return;
295 295
         }
296 296
 
297
-        $geom     = new GeometryCollection ($geoms);
297
+        $geom     = new GeometryCollection($geoms);
298 298
         $centroid = $geom->centroid();
299 299
         $bbox     = $geom->getBBox();
300 300
 
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
         $vy0 = log(tan(M_PI * (0.25 + $bbox ['miny'] / 360)));
304 304
         $vy1 = log(tan(M_PI * (0.25 + $bbox ['maxy'] / 360)));
305 305
         dbglog("StaticMap::autoZoom: vertical resolution: $vy0, $vy1");
306
-        if ($vy1 - $vy0 === 0.0){
306
+        if ($vy1 - $vy0 === 0.0) {
307 307
             $resolutionVertical = 0;
308 308
             dbglog("StaticMap::autoZoom: using $resolutionVertical");
309 309
         } else {
@@ -315,11 +315,11 @@  discard block
 block discarded – undo
315 315
         dbglog("StaticMap::autoZoom: using $resolutionHorizontal");
316 316
         $resolution           = max($resolutionHorizontal, $resolutionVertical) * $paddingFactor;
317 317
         $zoom                 = $this->zoom;
318
-        if ($resolution > 0){
318
+        if ($resolution > 0) {
319 319
             $zoom             = log(360 / ($resolution * $this->tileSize), 2);
320 320
         }
321 321
 
322
-        if(is_finite($zoom) && $zoom < 15 && $zoom > 2) {
322
+        if (is_finite($zoom) && $zoom < 15 && $zoom > 2) {
323 323
             $this->zoom = floor($zoom);
324 324
         }
325 325
         $this->lon = $centroid->getX();
@@ -352,12 +352,12 @@  discard block
 block discarded – undo
352 352
     }
353 353
 
354 354
     public function mapCacheIDToFilename(): string {
355
-        if(!$this->mapCacheFile) {
356
-            $this->mapCacheFile = $this->mapCacheBaseDir . "/" . $this->maptype . "/" . $this->zoom . "/cache_"
357
-                . substr($this->mapCacheID, 0, 2) . "/" . substr($this->mapCacheID, 2, 2)
358
-                . "/" . substr($this->mapCacheID, 4);
355
+        if (!$this->mapCacheFile) {
356
+            $this->mapCacheFile = $this->mapCacheBaseDir."/".$this->maptype."/".$this->zoom."/cache_"
357
+                . substr($this->mapCacheID, 0, 2)."/".substr($this->mapCacheID, 2, 2)
358
+                . "/".substr($this->mapCacheID, 4);
359 359
         }
360
-        return $this->mapCacheFile . "." . $this->mapCacheExtension;
360
+        return $this->mapCacheFile.".".$this->mapCacheExtension;
361 361
     }
362 362
 
363 363
     /**
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
     public function makeMap(): void {
367 367
         $this->initCoords();
368 368
         $this->createBaseMap();
369
-        if(!empty ($this->markers)) {
369
+        if (!empty ($this->markers)) {
370 370
             $this->placeMarkers();
371 371
         }
372 372
         if (file_exists($this->kmlFileName)) {
@@ -439,8 +439,8 @@  discard block
 block discarded – undo
439 439
         $this->offsetX += floor($startX - floor($this->centerX)) * $this->tileSize;
440 440
         $this->offsetY += floor($startY - floor($this->centerY)) * $this->tileSize;
441 441
 
442
-        for($x = $startX; $x <= $endX; $x++) {
443
-            for($y = $startY; $y <= $endY; $y++) {
442
+        for ($x = $startX; $x <= $endX; $x++) {
443
+            for ($y = $startY; $y <= $endY; $y++) {
444 444
                 $url = str_replace(
445 445
                     array(
446 446
                         '{Z}',
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
                 );
455 455
 
456 456
                 $tileData = $this->fetchTile($url);
457
-                if($tileData) {
457
+                if ($tileData) {
458 458
                     $tileImage = imagecreatefromstring($tileData);
459 459
                 } else {
460 460
                     $tileImage = imagecreate($this->tileSize, $this->tileSize);
@@ -480,17 +480,17 @@  discard block
 block discarded – undo
480 480
      *          for better proxy handling...
481 481
      */
482 482
     public function fetchTile(string $url) {
483
-        if($this->useTileCache && ($cached = $this->checkTileCache($url)))
483
+        if ($this->useTileCache && ($cached = $this->checkTileCache($url)))
484 484
             return $cached;
485 485
 
486
-        $_UA = 'Mozilla/4.0 (compatible; DokuWikiSpatial HTTP Client; ' . PHP_OS . ')';
487
-        if(function_exists("curl_init")) {
486
+        $_UA = 'Mozilla/4.0 (compatible; DokuWikiSpatial HTTP Client; '.PHP_OS.')';
487
+        if (function_exists("curl_init")) {
488 488
             // use cUrl
489 489
             $ch = curl_init();
490 490
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
491 491
             curl_setopt($ch, CURLOPT_USERAGENT, $_UA);
492 492
             curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
493
-            curl_setopt($ch, CURLOPT_URL, $url . $this->apikey);
493
+            curl_setopt($ch, CURLOPT_URL, $url.$this->apikey);
494 494
             dbglog("StaticMap::fetchTile: getting: $url using curl_exec");
495 495
             $tile = curl_exec($ch);
496 496
             curl_close($ch);
@@ -500,21 +500,21 @@  discard block
 block discarded – undo
500 500
             $opts = array(
501 501
                 'http' => array(
502 502
                     'method'          => "GET",
503
-                    'header'          => "Accept-language: en\r\n" . "User-Agent: $_UA\r\n" . "accept: image/png\r\n",
503
+                    'header'          => "Accept-language: en\r\n"."User-Agent: $_UA\r\n"."accept: image/png\r\n",
504 504
                     'request_fulluri' => true
505 505
                 )
506 506
             );
507
-            if(isset($conf['proxy']['host'], $conf['proxy']['port'])
507
+            if (isset($conf['proxy']['host'], $conf['proxy']['port'])
508 508
                 && $conf['proxy']['host'] !== ''
509 509
                 && $conf['proxy']['port'] !== '') {
510
-                $opts['http'] += ['proxy' => "tcp://" . $conf['proxy']['host'] . ":" . $conf['proxy']['port']];
510
+                $opts['http'] += ['proxy' => "tcp://".$conf['proxy']['host'].":".$conf['proxy']['port']];
511 511
             }
512 512
 
513 513
             $context = stream_context_create($opts);
514 514
             dbglog("StaticMap::fetchTile: getting: $url . $this->apikey using file_get_contents and options $opts");
515
-            $tile = file_get_contents($url . $this->apikey, false, $context);
515
+            $tile = file_get_contents($url.$this->apikey, false, $context);
516 516
         }
517
-        if($tile && $this->useTileCache) {
517
+        if ($tile && $this->useTileCache) {
518 518
             $this->writeTileToCache($url, $tile);
519 519
         }
520 520
         return $tile;
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
      */
528 528
     public function checkTileCache(string $url) {
529 529
         $filename = $this->tileUrlToFilename($url);
530
-        if(file_exists($filename)) {
530
+        if (file_exists($filename)) {
531 531
             return file_get_contents($filename);
532 532
         }
533 533
         return false;
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
      * @return string
540 540
      */
541 541
     public function tileUrlToFilename(string $url): string {
542
-        return $this->tileCacheBaseDir . "/" . substr($url, strpos($url, '/') + 1);
542
+        return $this->tileCacheBaseDir."/".substr($url, strpos($url, '/') + 1);
543 543
     }
544 544
 
545 545
     /**
@@ -574,14 +574,14 @@  discard block
 block discarded – undo
574 574
         $count         = 0;
575 575
         $color         = imagecolorallocate($this->image, 0, 0, 0);
576 576
         $bgcolor       = imagecolorallocate($this->image, 200, 200, 200);
577
-        $markerBaseDir = __DIR__ . '/icons';
577
+        $markerBaseDir = __DIR__.'/icons';
578 578
         $markerImageOffsetX  = 0;
579 579
         $markerImageOffsetY  = 0;
580 580
         $markerShadowOffsetX = 0;
581 581
         $markerShadowOffsetY = 0;
582 582
         $markerShadowImg     = null;
583 583
         // loop thru marker array
584
-        foreach($this->markers as $marker) {
584
+        foreach ($this->markers as $marker) {
585 585
             // set some local variables
586 586
             $markerLat  = $marker ['lat'];
587 587
             $markerLon  = $marker ['lon'];
@@ -591,18 +591,18 @@  discard block
 block discarded – undo
591 591
             $markerShadow   = '';
592 592
             $matches        = false;
593 593
             // check for marker type, get settings from markerPrototypes
594
-            if($markerType) {
595
-                foreach($this->markerPrototypes as $markerPrototype) {
596
-                    if(preg_match($markerPrototype ['regex'], $markerType, $matches)) {
597
-                        $markerFilename = $matches [0] . $markerPrototype ['extension'];
598
-                        if($markerPrototype ['offsetImage']) {
594
+            if ($markerType) {
595
+                foreach ($this->markerPrototypes as $markerPrototype) {
596
+                    if (preg_match($markerPrototype ['regex'], $markerType, $matches)) {
597
+                        $markerFilename = $matches [0].$markerPrototype ['extension'];
598
+                        if ($markerPrototype ['offsetImage']) {
599 599
                             list ($markerImageOffsetX, $markerImageOffsetY) = explode(
600 600
                                 ",",
601 601
                                 $markerPrototype ['offsetImage']
602 602
                             );
603 603
                         }
604 604
                         $markerShadow = $markerPrototype ['shadow'];
605
-                        if($markerShadow) {
605
+                        if ($markerShadow) {
606 606
                             list ($markerShadowOffsetX, $markerShadowOffsetY) = explode(
607 607
                                 ",",
608 608
                                 $markerPrototype ['offsetShadow']
@@ -612,14 +612,14 @@  discard block
 block discarded – undo
612 612
                 }
613 613
             }
614 614
             // create img resource
615
-            if(file_exists($markerBaseDir . '/' . $markerFilename)) {
616
-                $markerImg = imagecreatefrompng($markerBaseDir . '/' . $markerFilename);
615
+            if (file_exists($markerBaseDir.'/'.$markerFilename)) {
616
+                $markerImg = imagecreatefrompng($markerBaseDir.'/'.$markerFilename);
617 617
             } else {
618
-                $markerImg = imagecreatefrompng($markerBaseDir . '/marker.png');
618
+                $markerImg = imagecreatefrompng($markerBaseDir.'/marker.png');
619 619
             }
620 620
             // check for shadow + create shadow recource
621
-            if($markerShadow && file_exists($markerBaseDir . '/' . $markerShadow)) {
622
-                $markerShadowImg = imagecreatefrompng($markerBaseDir . '/' . $markerShadow);
621
+            if ($markerShadow && file_exists($markerBaseDir.'/'.$markerShadow)) {
622
+                $markerShadowImg = imagecreatefrompng($markerBaseDir.'/'.$markerShadow);
623 623
             }
624 624
             // calc position
625 625
             $destX = floor(
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
                 $this->tileSize * ($this->centerY - $this->latToTile($markerLat, $this->zoom))
632 632
             );
633 633
             // copy shadow on basemap
634
-            if($markerShadow && $markerShadowImg) {
634
+            if ($markerShadow && $markerShadowImg) {
635 635
                 imagecopy(
636 636
                     $this->image,
637 637
                     $markerShadowImg,
@@ -693,14 +693,14 @@  discard block
 block discarded – undo
693 693
      *            drawing colour
694 694
      */
695 695
     private function drawGeometry(Geometry $geom, int $colour): void {
696
-        if(empty($geom)) {
696
+        if (empty($geom)) {
697 697
             return;
698 698
         }
699 699
 
700
-        switch($geom->geometryType()) {
700
+        switch ($geom->geometryType()) {
701 701
             case 'GeometryCollection' :
702 702
                 // recursively draw part of the collection
703
-                for($i = 1; $i < $geom->numGeometries() + 1; $i++) {
703
+                for ($i = 1; $i < $geom->numGeometries() + 1; $i++) {
704 704
                     $_geom = $geom->geometryN($i);
705 705
                     $this->drawGeometry($_geom, $colour);
706 706
                 }
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
         // extring is a linestring actually..
743 743
         $extRing = $polygon->exteriorRing();
744 744
 
745
-        for($i = 1; $i < $extRing->numGeometries(); $i++) {
745
+        for ($i = 1; $i < $extRing->numGeometries(); $i++) {
746 746
             $p1           = $extRing->geometryN($i);
747 747
             $x            = floor(
748 748
                 ($this->width / 2) - $this->tileSize * ($this->centerX - $this->lonToTile($p1->x(), $this->zoom))
@@ -768,7 +768,7 @@  discard block
 block discarded – undo
768 768
      */
769 769
     private function drawLineString($line, $colour) {
770 770
         imagesetthickness($this->image, 2);
771
-        for($p = 1; $p < $line->numGeometries(); $p++) {
771
+        for ($p = 1; $p < $line->numGeometries(); $p++) {
772 772
             // get first pair of points
773 773
             $p1 = $line->geometryN($p);
774 774
             $p2 = $line->geometryN($p + 1);
@@ -841,8 +841,8 @@  discard block
 block discarded – undo
841 841
      * add copyright and origin notice and icons to the map.
842 842
      */
843 843
     public function drawCopyright() {
844
-        $logoBaseDir = dirname(__FILE__) . '/' . 'logo/';
845
-        $logoImg     = imagecreatefrompng($logoBaseDir . $this->tileInfo ['openstreetmap'] ['logo']);
844
+        $logoBaseDir = dirname(__FILE__).'/'.'logo/';
845
+        $logoImg     = imagecreatefrompng($logoBaseDir.$this->tileInfo ['openstreetmap'] ['logo']);
846 846
         $textcolor   = imagecolorallocate($this->image, 0, 0, 0);
847 847
         $bgcolor     = imagecolorallocate($this->image, 200, 200, 200);
848 848
 
@@ -875,11 +875,11 @@  discard block
 block discarded – undo
875 875
 
876 876
         // additional tile source info, ie. who created/hosted the tiles
877 877
         $xIconOffset = 0;
878
-        if($this->maptype === 'openstreetmap') {
878
+        if ($this->maptype === 'openstreetmap') {
879 879
             $mapAuthor = "(c) OpenStreetMap maps/CC BY-SA";
880 880
         } else {
881 881
             $mapAuthor   = $this->tileInfo [$this->maptype] ['txt'];
882
-            $iconImg     = imagecreatefrompng($logoBaseDir . $this->tileInfo [$this->maptype] ['logo']);
882
+            $iconImg     = imagecreatefrompng($logoBaseDir.$this->tileInfo [$this->maptype] ['logo']);
883 883
             $xIconOffset = imagesx($iconImg);
884 884
             imagecopy(
885 885
                 $this->image,
Please login to merge, or discard this patch.
syntax/wmslayer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -119,13 +119,13 @@
 block discarded – undo
119 119
         // incremented for each olmap_wmslayer tag in the page source
120 120
         static $overlaynumber = 0;
121 121
 
122
-        $renderer->doc .= DOKU_LF . '<script defer="defer" src="data:text/javascript;base64,';
123
-        $str           = '{';
122
+        $renderer->doc .= DOKU_LF.'<script defer="defer" src="data:text/javascript;base64,';
123
+        $str = '{';
124 124
         foreach ($data as $key => $val) {
125
-            $str .= "'" . $key . "' : '" . $val . "',";
125
+            $str .= "'".$key."' : '".$val."',";
126 126
         }
127 127
         $str           .= "'type':'wms'}";
128
-        $renderer->doc .= base64_encode("olMapOverlays['wms" . $overlaynumber . "'] = " . $str . ";")
128
+        $renderer->doc .= base64_encode("olMapOverlays['wms".$overlaynumber."'] = ".$str.";")
129 129
             . '"></script>';
130 130
         $overlaynumber++;
131 131
         return true;
Please login to merge, or discard this patch.
syntax/osmlayer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -116,13 +116,13 @@
 block discarded – undo
116 116
         // incremented for each olmap_osmlayer tag in the page source
117 117
         static $overlaynumber = 0;
118 118
 
119
-        $renderer->doc .= DOKU_LF . '<script defer="defer" src="data:text/javascript;base64,';
120
-        $str           = '{';
119
+        $renderer->doc .= DOKU_LF.'<script defer="defer" src="data:text/javascript;base64,';
120
+        $str = '{';
121 121
         foreach ($data as $key => $val) {
122
-            $str .= "'" . $key . "' : '" . $val . "',";
122
+            $str .= "'".$key."' : '".$val."',";
123 123
         }
124 124
         $str           .= '"type":"osm"}';
125
-        $renderer->doc .= base64_encode("olMapOverlays['osm" . $overlaynumber . "'] = " . $str . ";")
125
+        $renderer->doc .= base64_encode("olMapOverlays['osm".$overlaynumber."'] = ".$str.";")
126 126
             . '"></script>';
127 127
         $overlaynumber++;
128 128
         return true;
Please login to merge, or discard this patch.
syntax/agslayer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -120,13 +120,13 @@
 block discarded – undo
120 120
         // incremented for each olmap_agslayer tag in the page source
121 121
         static $overlaynumber = 0;
122 122
 
123
-        $renderer->doc .= DOKU_LF . '<script defer="defer" src="data:text/javascript;base64,';
124
-        $str           = '{';
123
+        $renderer->doc .= DOKU_LF.'<script defer="defer" src="data:text/javascript;base64,';
124
+        $str = '{';
125 125
         foreach ($data as $key => $val) {
126
-            $str .= "'" . $key . "' : '" . $val . "',";
126
+            $str .= "'".$key."' : '".$val."',";
127 127
         }
128 128
         $str           .= "'type':'ags'}";
129
-        $renderer->doc .= base64_encode("olMapOverlays['ags" . $overlaynumber . "'] = " . $str . ";")
129
+        $renderer->doc .= base64_encode("olMapOverlays['ags".$overlaynumber."'] = ".$str.";")
130 130
             . '"></script>';
131 131
         $overlaynumber++;
132 132
         return true;
Please login to merge, or discard this patch.