Passed
Pull Request — development (#359)
by Markus
08:05
created
htdocs/lib2/logic/logtypes.inc.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -91,28 +91,28 @@  discard block
 block discarded – undo
91 91
 
92 92
     $allowed_logtypes = array();
93 93
     if ($owner || $admin_report || $admin_locked) {
94
-        $allowed_logtypes[] = 3;   // note
94
+        $allowed_logtypes[] = 3; // note
95 95
     }
96 96
     if (($owner && $statuslogs) || $admin_report) {
97 97
         if ($cache_status != 5 && (($cache_status != 4 && $cache_status != 7) || $admin_report)) {
98
-            $allowed_logtypes[] = 10;  // ready for search
99
-            $allowed_logtypes[] = 11;  // temporarily not available
100
-            $allowed_logtypes[] = 9;   // archived
101
-            $allowed_logtypes[] = 13;  // locked
98
+            $allowed_logtypes[] = 10; // ready for search
99
+            $allowed_logtypes[] = 11; // temporarily not available
100
+            $allowed_logtypes[] = 9; // archived
101
+            $allowed_logtypes[] = 13; // locked
102 102
         }
103 103
         if ($admin_report || $old_logtype == 14) {
104 104
             $allowed_logtypes[] = 14;
105 105
         }  // locked, invisible
106 106
     }
107 107
     if ($cache_type == 6) { // event
108
-        $allowed_logtypes[] = 8;   // will attend
109
-        $allowed_logtypes[] = 7;   // attended
108
+        $allowed_logtypes[] = 8; // will attend
109
+        $allowed_logtypes[] = 7; // attended
110 110
     } else {
111
-        $allowed_logtypes[] = 1;   // found
112
-        $allowed_logtypes[] = 2;   // not found
111
+        $allowed_logtypes[] = 1; // found
112
+        $allowed_logtypes[] = 2; // not found
113 113
     }
114 114
     if (!($owner || $admin_report || $admin_locked)) {
115
-        $allowed_logtypes[] = 3;   // note
115
+        $allowed_logtypes[] = 3; // note
116 116
     }
117 117
 
118 118
     // always allow to keep the existing logtype when the log is edited by an admin
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
             } elseif (!$opt['logic']['admin']['team_comments_only_for_reports'] || admin_has_open_report($cache_id)) {
152 152
                 // allowed for report processing by admins
153 153
                 $allowed = true;
154
-            } elseif ($login->hasAdminPriv(ADMIN_USER) && in_array($rCache['status'], [6,7])) {
154
+            } elseif ($login->hasAdminPriv(ADMIN_USER) && in_array($rCache['status'], [6, 7])) {
155 155
                 // allowed for admins && locked caches, see http://forum.opencaching.de/index.php?topic=3102.msg39517#msg39517
156 156
                 $allowed = true;
157 157
             } else {
Please login to merge, or discard this patch.
htdocs/lib2/logic/cacheIcon.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
     public static function get($user_id, $cache_id, $cache_status, $cache_userid, $iconname)
12 12
     {
13
-        $iconname = mb_eregi_replace("cache/", "", $iconname);   // for old cache_type table contents
13
+        $iconname = mb_eregi_replace("cache/", "", $iconname); // for old cache_type table contents
14 14
         $iconext = "." . mb_eregi_replace("^.*\.", "", $iconname);
15 15
         $iconname = mb_eregi_replace("\..*", "", $iconname);
16 16
 
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
                 break;
31 31
             case 5:
32 32
                 $iconname .= "-s";
33
-                break;      // fix for RT ticket #3403
33
+                break; // fix for RT ticket #3403
34 34
             case 6:
35 35
                 $iconname .= "-a";
36 36
                 break;
Please login to merge, or discard this patch.
htdocs/lib2/logic/sitemapxml.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 {
13 13
     public $sDefaultChangeFreq = 'monthly';
14 14
     public $nMaxFileSize = 9961472; // max file size, 10MB by specification
15
-    public $nMaxUrlCount = 50000;   // max number of URLs per file, 50000 by specification
15
+    public $nMaxUrlCount = 50000; // max number of URLs per file, 50000 by specification
16 16
 
17 17
     public $sPath = '';
18 18
     public $sDomain = '';
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
         // open new XML file?
77 77
         if ($this->oSitemapFile === false) {
78
-            $this->nSitemapIndex ++;
78
+            $this->nSitemapIndex++;
79 79
             $sFilename = 'sitemap-' . $this->nSitemapIndex . '.xml.gz';
80 80
             $this->oSitemapFile = gzopen($this->sPath . $sFilename, 'wb');
81 81
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         // write string to XML
92 92
         gzwrite($this->oSitemapFile, $str);
93 93
         $this->nWrittenSize += strlen($str);
94
-        $this->nWrittenCount ++;
94
+        $this->nWrittenCount++;
95 95
     }
96 96
 
97 97
     public function close()
Please login to merge, or discard this patch.
htdocs/lib2/logic/coordinate.class.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -175,8 +175,8 @@  discard block
 block discarded – undo
175 175
                 0
176 176
             ];
177 177
         }
178
-        $lw = (float) $this->nLon;
179
-        $bw = (float) $this->nLat;
178
+        $lw = (float)$this->nLon;
179
+        $bw = (float)$this->nLat;
180 180
 
181 181
         //WGS84 Datum
182 182
         //Große Halbachse a und Abplattung f
@@ -195,9 +195,9 @@  discard block
 block discarded – undo
195 195
 
196 196
         //Koeffizienten zur Berechnung der Meridianbogenlänge
197 197
         $e0 = $c * (pi() / 180) * (1 - 3 * $ex2 / 4 + 45 * $ex4 / 64 - 175 * $ex6 / 256 + 11025 * $ex8 / 16384);
198
-        $e2 = $c * (- 3 * $ex2 / 8 + 15 * $ex4 / 32 - 525 * $ex6 / 1024 + 2205 * $ex8 / 4096);
198
+        $e2 = $c * (-3 * $ex2 / 8 + 15 * $ex4 / 32 - 525 * $ex6 / 1024 + 2205 * $ex8 / 4096);
199 199
         $e4 = $c * (15 * $ex4 / 256 - 105 * $ex6 / 1024 + 2205 * $ex8 / 16384);
200
-        $e6 = $c * (- 35 * $ex6 / 3072 + 315 * $ex8 / 12288);
200
+        $e6 = $c * (-35 * $ex6 / 3072 + 315 * $ex8 / 12288);
201 201
 
202 202
         //Längenzone lz und Breitenzone (Band) bz
203 203
         $lzn = intval(($lw + 180) / 6) + 1;
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
         if ($lzn < 10) {
224 224
             $lz = "0" . $lzn;
225 225
         }
226
-        $bd = (int) (1 + ($bw + 80) / 8);
226
+        $bd = (int)(1 + ($bw + 80) / 8);
227 227
         $bz = substr($b_sel, $bd - 1, 1);
228 228
 
229 229
         //Geographische Breite in Radianten br
@@ -268,20 +268,20 @@  discard block
 block discarded – undo
268 268
         $ew = 0.9996 * ($nd * $cos1 * $dl + $nd * $cos3 * (1 - $tan2 + $etasq) * $dl3 / 6 +
269 269
                 $nd * $cos5 * (5 - 18 * $tan2 + $tan4) * $dl5 / 120) + 500000;
270 270
 
271
-        $nk = $nw - (int) $nw;
271
+        $nk = $nw - (int)$nw;
272 272
         if ($nk < 0.5) {
273
-            $nw = '' . (int) $nw;
273
+            $nw = '' . (int)$nw;
274 274
         } else {
275
-            $nw = '' . ((int) $nw + 1);
275
+            $nw = '' . ((int)$nw + 1);
276 276
         }
277 277
 
278 278
         while (strlen($nw) < 7) {
279 279
             $nw = '0' . $nw;
280 280
         }
281 281
 
282
-        $nk = $ew - (int) $ew;
282
+        $nk = $ew - (int)$ew;
283 283
         if ($nk < 0.5) {
284
-            $ew = '0' . (int) $ew;
284
+            $ew = '0' . (int)$ew;
285 285
         } else {
286 286
             $ew = '0' . intval($ew + 1);
287 287
         }
@@ -331,8 +331,8 @@  discard block
 block discarded – undo
331 331
                 0
332 332
             ];
333 333
         }
334
-        $lw = (float) $lw;
335
-        $bw = (float) $bw;
334
+        $lw = (float)$lw;
335
+        $bw = (float)$bw;
336 336
 
337 337
         // Quellsystem WGS 84 Datum
338 338
         // Große Halbachse a und Abplattung fq
@@ -410,8 +410,8 @@  discard block
 block discarded – undo
410 410
                 0
411 411
             ];
412 412
         }
413
-        $lp = (float) $lp;
414
-        $bp = (float) $bp;
413
+        $lp = (float)$lp;
414
+        $bp = (float)$bp;
415 415
 
416 416
         // Potsdam Datum
417 417
         // Große Halbachse a und Abplattung f
@@ -429,9 +429,9 @@  discard block
 block discarded – undo
429 429
 
430 430
         // Koeffizienten zur Berechnung der Meridianbogenlänge
431 431
         $e0 = $c * (pi() / 180) * (1 - 3 * $ex2 / 4 + 45 * $ex4 / 64 - 175 * $ex6 / 256 + 11025 * $ex8 / 16384);
432
-        $e2 = $c * (- 3 * $ex2 / 8 + 15 * $ex4 / 32 - 525 * $ex6 / 1024 + 2205 * $ex8 / 4096);
432
+        $e2 = $c * (-3 * $ex2 / 8 + 15 * $ex4 / 32 - 525 * $ex6 / 1024 + 2205 * $ex8 / 4096);
433 433
         $e4 = $c * (15 * $ex4 / 256 - 105 * $ex6 / 1024 + 2205 * $ex8 / 16384);
434
-        $e6 = $c * (- 35 * $ex6 / 3072 + 315 * $ex8 / 12288);
434
+        $e6 = $c * (-35 * $ex6 / 3072 + 315 * $ex8 / 12288);
435 435
 
436 436
         // Breite in Radianten
437 437
         $br = $bp * pi() / 180;
@@ -469,18 +469,18 @@  discard block
 block discarded – undo
469 469
         $rw = ($nd * $cos1 * $dl + $nd * $cos3 * (1 - $tan2 + $etasq) * $dl3 / 6 +
470 470
             $nd * $cos5 * (5 - 18 * $tan2 + $tan4) * $dl5 / 120 + $kz * 1e6 + 500000);
471 471
 
472
-        $nk = $hw - (int) $hw;
472
+        $nk = $hw - (int)$hw;
473 473
         if ($nk < 0.5) {
474
-            $hw = (int) $hw;
474
+            $hw = (int)$hw;
475 475
         } else {
476
-            $hw = ((int) $hw) + 1;
476
+            $hw = ((int)$hw) + 1;
477 477
         }
478 478
 
479
-        $nk = $rw - (int) $rw;
479
+        $nk = $rw - (int)$rw;
480 480
         if ($nk < 0.5) {
481
-            $rw = (int) $rw;
481
+            $rw = (int)$rw;
482 482
         } else {
483
-            $rw = (int) ($rw + 1);
483
+            $rw = (int)($rw + 1);
484 484
         }
485 485
 
486 486
         return [
@@ -499,8 +499,8 @@  discard block
 block discarded – undo
499 499
         $lat_base = 52.15517440;
500 500
         $lon_base = 5.38720621;
501 501
 
502
-        for ($i = 0; $i <= 6; $i ++) {
503
-            for ($j = 0; $j <= 5; $j ++) {
502
+        for ($i = 0; $i <= 6; $i++) {
503
+            for ($j = 0; $j <= 5; $j++) {
504 504
                 $rpq[$i][$j] = 0;
505 505
                 $spq[$i][$j] = 0;
506 506
             }
@@ -535,8 +535,8 @@  discard block
 block discarded – undo
535 535
         $xOrigin = 0;
536 536
         $yOrigin = 0;
537 537
 
538
-        for ($q = 0; $q <= 5; $q ++) {
539
-            for ($p = 0; $p <= 6; $p ++) {
538
+        for ($q = 0; $q <= 5; $q++) {
539
+            for ($p = 0; $p <= 6; $p++) {
540 540
                 $xOrigin = $xOrigin + ($rpq[$p][$q] * ((pow($dlat, $p)) * (pow($dlon, $q))));
541 541
                 $yOrigin = $yOrigin + ($spq[$p][$q] * ((pow($dlat, $p)) * (pow($dlon, $q))));
542 542
             }
Please login to merge, or discard this patch.
htdocs/lib2/logic/picture.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -435,9 +435,9 @@
 block discarded – undo
435 435
                 return false;
436 436
             } else {
437 437
                 // restore picture file
438
-                $this->setUrl($original_url);        // set the url, so that we can
439
-                $filename = $this->getFilename();    // .. retreive the file path+name
440
-                $this->setFilenames($filename);      // now set url(s) from the new uuid
438
+                $this->setUrl($original_url); // set the url, so that we can
439
+                $filename = $this->getFilename(); // .. retreive the file path+name
440
+                $this->setFilenames($filename); // now set url(s) from the new uuid
441 441
                 @rename($this->deleted_filename($filename), $this->getFilename());
442 442
             }
443 443
         }
Please login to merge, or discard this patch.
htdocs/lib2/logic/cachelog.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -355,7 +355,7 @@
 block discarded – undo
355 355
         //     return array();
356 356
         // Logic Error - log types are still valid when no NEW logs are allowed for the cache.
357 357
         // (Would e.g. block admin logs and log-type restoring for locked caches.)
358
-        return get_cache_log_types($this->getCacheId(), $this->getType());  // depends on userid
358
+        return get_cache_log_types($this->getCacheId(), $this->getType()); // depends on userid
359 359
     }
360 360
 
361 361
     public static function isDuplicate($cacheId, $userId, $logType, $logDate, $logText)
Please login to merge, or discard this patch.
htdocs/lib2/logic/gis.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         // number of points in the polygon
30 30
         $n = count($polygon);
31 31
         $poly1 = $polygon[0];
32
-        for ($i = 1; $i <= $n; $i ++) {
32
+        for ($i = 1; $i <= $n; $i++) {
33 33
             $poly1XY = explode(' ', $poly1);
34 34
             $poly1x = $poly1XY[0];
35 35
             $poly1y = $poly1XY[1];
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
                         if ($poly1y != $poly2y) {
45 45
                             $xinters = ($py - $poly1y) * ($poly2x - $poly1x) / ($poly2y - $poly1y) + $poly1x;
46 46
                             if ($poly1x == $poly2x || $px <= $xinters) {
47
-                                $counter ++;
47
+                                $counter++;
48 48
                             }
49 49
                         }
50 50
                     }
Please login to merge, or discard this patch.
htdocs/lib2/logic/cache.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
                 if (!$newcoord) {
522 522
                     $newcoord = $coords[$coordpos];
523 523
                 }
524
-                ++ $coordpos;
524
+                ++$coordpos;
525 525
             }
526 526
             if ($newcoord) {
527 527
                 $distance = geomath::calcDistance(
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
             $original = count($coords) - 1;
555 555
             $lastlogdate = $logs[count($logs) - 1]['order_date'];
556 556
             while ($original > 0 && $coords[$original - 1]['date'] < $lastlogdate) {
557
-                -- $original;
557
+                --$original;
558 558
             }
559 559
             $coord = new coordinate($coords[$original]['latitude'], $coords[$original]['longitude']);
560 560
             $logs[] = [
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
             $logTypes[$i]['selected'] = ($logtype == $defaultLogType) ? true : false;
956 956
             $logTypes[$i]['name'] = $logtypeNames[$logtype];
957 957
             $logTypes[$i]['id'] = $logtype;
958
-            $i ++;
958
+            $i++;
959 959
         }
960 960
 
961 961
         // return
Please login to merge, or discard this patch.
htdocs/lib2/logic/cracklib.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
     // min. 4 different chars
36 36
     $chars = array();
37
-    for ($i = 0; $i < mb_strlen($pw); $i ++) {
37
+    for ($i = 0; $i < mb_strlen($pw); $i++) {
38 38
         $chars[mb_substr($pw, $i, 1)] = true;
39 39
     }
40 40
 
Please login to merge, or discard this patch.