Passed
Pull Request — development (#682)
by Nick
07:18
created
htdocs/lib2/search/ftsearch.inc.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
 /**
69 69
  * str = single word
70 70
  * @param $str
71
- * @param $simple
71
+ * @param boolean $simple
72 72
  *
73
- * @return array
73
+ * @return string
74 74
  */
75 75
 function ftsearch_split(&$str, $simple)
76 76
 {
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
  * str = single word
142 142
  * @param $str
143 143
  *
144
- * @return mixed|string
144
+ * @return string
145 145
  */
146 146
 function ftsearch_text2simple($str)
147 147
 {
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
  * str = single word
172 172
  * @param $str
173 173
  *
174
- * @return mixed|string
174
+ * @return string
175 175
  */
176 176
 function ftsearch_text2sort($str)
177 177
 {
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 /**
315 315
  * @param $text
316 316
  *
317
- * @return mixed|string
317
+ * @return string
318 318
  */
319 319
 function ftsearch_strip_html($text)
320 320
 {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     ['ai', 'ei'],
18 18
     ['ou', 'u'],
19 19
     ['th', 't'],
20
-    ['ph','f'],
20
+    ['ph', 'f'],
21 21
     ['oh', 'o'],
22 22
     ['ah', 'a'],
23 23
     ['eh', 'e'],
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     $str = '';
102 102
 
103 103
     ftsearch_load_ignores();
104
-    for ($i = count($astr) - 1; $i >= 0; $i --) {
104
+    for ($i = count($astr) - 1; $i >= 0; $i--) {
105 105
         // ignore?
106 106
         if (array_search(mb_strtolower($astr[$i]), $ftsearch_ignores) !== false) {
107 107
             unset($astr[$i]);
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
     // doppelte chars ersetzen
158 158
     $ordZ = ord('z');
159
-    for ($c = ord('a'); $c <= $ordZ; $c ++) {
159
+    for ($c = ord('a'); $c <= $ordZ; $c++) {
160 160
         $old_str = '';
161 161
         while ($old_str !== $str) {
162 162
             $old_str = $str;
Please login to merge, or discard this patch.
htdocs/src/Oc/Translation/CrowdinExport.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         $select = '';
28 28
         $joins = '';
29 29
         foreach (['de', 'fr', 'nl', 'es', 'pl', 'it', 'ru'] as $languageKey) {
30
-            $joins .= "\n".' LEFT JOIN sys_trans_text ' . $languageKey . ' ON ' . $languageKey . '.trans_id = source.trans_id AND ' . $languageKey . '.lang = "' . $languageKey . '" ';
30
+            $joins .= "\n" . ' LEFT JOIN sys_trans_text ' . $languageKey . ' ON ' . $languageKey . '.trans_id = source.trans_id AND ' . $languageKey . '.lang = "' . $languageKey . '" ';
31 31
             $select .= ', ' . $languageKey . '.text as ' . $languageKey . ' ';
32 32
         }
33 33
 
Please login to merge, or discard this patch.
htdocs/okapi_settings.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
         'OC_COOKIE_NAME'   => $opt['session']['cookiename'] . 'data',
53 53
         'VERSION_FILE'     => __DIR__ . '/okapi/meta.php',
54 54
         'OCDE_HTML_PURIFIER_SETTINGS'
55
-                           => $opt['html_purifier'],
55
+                            => $opt['html_purifier'],
56 56
         'GITHUB_ACCESS_TOKEN' => $opt['okapi']['github_access_token'],
57 57
     ];
58 58
 }
Please login to merge, or discard this patch.
htdocs/okapi/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$GLOBALS['rootpath'] = __DIR__.'/../';
3
+$GLOBALS['rootpath'] = __DIR__ . '/../';
4 4
 
5 5
 require_once __DIR__ . '/../vendor/autoload.php';
6 6
 
7
-require_once __DIR__ .'/../vendor/opencaching/okapi/okapi/index.php';
7
+require_once __DIR__ . '/../vendor/opencaching/okapi/okapi/index.php';
Please login to merge, or discard this patch.
htdocs/lib2/search/search.gpx.inc.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -140,19 +140,19 @@  discard block
 block discarded – undo
140 140
     $gpxTimeFormat = 'Y-m-d\TH:i:s\Z';
141 141
 
142 142
     $gpxStatus[0] = 'available="False" archived="False"'; // other (unavailable, not archived)
143
-    $gpxStatus[1] = 'available="True" archived="False"';  // available, not archived
143
+    $gpxStatus[1] = 'available="True" archived="False"'; // available, not archived
144 144
     $gpxStatus[2] = 'available="False" archived="False"'; // unavailable, not archived
145
-    $gpxStatus[3] = 'available="False" archived="True"';  // unavailable, archived
146
-    $gpxStatus[6] = 'available="False" archived="True"';  // locked, visible
145
+    $gpxStatus[3] = 'available="False" archived="True"'; // unavailable, archived
146
+    $gpxStatus[6] = 'available="False" archived="True"'; // locked, visible
147 147
 
148 148
     $gpxContainer[1] = 'Other';
149 149
     $gpxContainer[2] = 'Micro';
150 150
     $gpxContainer[3] = 'Small';
151 151
     $gpxContainer[4] = 'Regular';
152 152
     $gpxContainer[5] = 'Large';
153
-    $gpxContainer[6] = 'Large';     // very large
154
-    $gpxContainer[7] = 'Virtual';   // no container
155
-    $gpxContainer[8] = 'Micro';     // nano
153
+    $gpxContainer[6] = 'Large'; // very large
154
+    $gpxContainer[7] = 'Virtual'; // no container
155
+    $gpxContainer[8] = 'Micro'; // nano
156 156
 
157 157
     $gpxOcSize[1] = 'Other';
158 158
     $gpxOcSize[2] = 'Micro';
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
     $gpxType[4] = 'Virtual Cache';
170 170
     $gpxType[5] = 'Webcam Cache';
171 171
     $gpxType[6] = 'Event Cache';
172
-    $gpxType[7] = 'Unknown Cache';        // quiz cache
173
-    $gpxType[8] = 'Unknown Cache';        // maths/physics cache
174
-    $gpxType[9] = 'Unknown Cache';        // moving cache
175
-    $gpxType[10] = 'Traditional Cache';   // drive-in cache
172
+    $gpxType[7] = 'Unknown Cache'; // quiz cache
173
+    $gpxType[8] = 'Unknown Cache'; // maths/physics cache
174
+    $gpxType[9] = 'Unknown Cache'; // moving cache
175
+    $gpxType[10] = 'Traditional Cache'; // drive-in cache
176 176
 
177 177
     $gpxOcType[1] = 'Other Cache';
178 178
     $gpxOcType[2] = 'Traditional Cache';
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
     $gpxOcType[5] = 'Webcam Cache';
182 182
     $gpxOcType[6] = 'Event Cache';
183 183
     $gpxOcType[7] = 'Quiz Cache';
184
-    $gpxOcType[8] = 'Quiz Cache';         // maths/physics cache
184
+    $gpxOcType[8] = 'Quiz Cache'; // maths/physics cache
185 185
     $gpxOcType[9] = 'Moving Cache';
186 186
     $gpxOcType[10] = 'Traditional Cache'; // drive-in cache
187 187
 
@@ -194,8 +194,8 @@  discard block
 block discarded – undo
194 194
     $gpxLogType[9] = 'Archive';
195 195
     $gpxLogType[10] = 'Owner Maintenance';
196 196
     $gpxLogType[11] = 'Temporarily Disable Listing';
197
-    $gpxLogType[13] = 'Archive';          // locked
198
-    $gpxLogType[14] = 'Archive';          // locked/invisible
197
+    $gpxLogType[13] = 'Archive'; // locked
198
+    $gpxLogType[14] = 'Archive'; // locked/invisible
199 199
 
200 200
     $gpxSymNormal = 'Geocache';
201 201
     $gpxSymFound = 'Geocache Found';
@@ -524,9 +524,9 @@  discard block
 block discarded – undo
524 524
         $thisline = mb_ereg_replace('{oc_logs}', $oc_logentries, $thisline);
525 525
 
526 526
         // attributes
527
-        $addAttributes = [-1];  // dummy
527
+        $addAttributes = [-1]; // dummy
528 528
         if ($r['type'] == 10) {   // Drive-in
529
-            $addAttributes[] = 24;  // near the car / park and grab
529
+            $addAttributes[] = 24; // near the car / park and grab
530 530
         }
531 531
         $rsAttributes = sql_slave(
532 532
             "
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
             $thiswp = mb_ereg_replace('{type}', text_xmlentities($wp_typename), $thiswp);
632 632
             $thiswp = mb_ereg_replace('{parent}', $r['waypoint'], $thiswp);
633 633
             $thiswp = mb_ereg_replace('{cacheid}', $r['cacheid'], $thiswp);
634
-            $waypoints .= $thiswp. "\n";
634
+            $waypoints .= $thiswp . "\n";
635 635
             ++$n;
636 636
         }
637 637
 
Please login to merge, or discard this patch.
htdocs/config2/settings-dist.inc.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
  *  Do not modify this file - use settings.inc.php!
8 8
  ***************************************************************************/
9 9
 
10
-require_once __DIR__. '/locale.inc.php';
11
-require_once __DIR__. '/settings-dist-common.inc.php';
10
+require_once __DIR__ . '/locale.inc.php';
11
+require_once __DIR__ . '/settings-dist-common.inc.php';
12 12
 
13 13
 /* PHP settings
14 14
  *
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 // database placeholder
108 108
 
109 109
 // productive database with opencaching-tables
110
-$opt['db']['placeholder']['db'] = '';    // selected by default
110
+$opt['db']['placeholder']['db'] = ''; // selected by default
111 111
 
112 112
 // empty database for temporary table creation
113 113
 $opt['db']['placeholder']['tmpdb'] = '';
@@ -121,14 +121,14 @@  discard block
 block discarded – undo
121 121
 $opt['system']['maillog']['syslog_db_user'] = '';
122 122
 $opt['system']['maillog']['syslog_db_password'] = '';
123 123
 $opt['system']['maillog']['syslog_db_table'] = '';
124
-$opt['system']['maillog']['syslog_oc_host'] = '';  // 'host_name' column in syslog DB
125
-$opt['system']['maillog']['syslog_mta'] = 'postfix/smtp%';  // 'program' column in syslog DB
126
-$opt['system']['maillog']['column']['id'] = 'id';               // 'ID'
127
-$opt['system']['maillog']['column']['created'] = 'created';     // 'ReceivedAt'
124
+$opt['system']['maillog']['syslog_oc_host'] = ''; // 'host_name' column in syslog DB
125
+$opt['system']['maillog']['syslog_mta'] = 'postfix/smtp%'; // 'program' column in syslog DB
126
+$opt['system']['maillog']['column']['id'] = 'id'; // 'ID'
127
+$opt['system']['maillog']['column']['created'] = 'created'; // 'ReceivedAt'
128 128
 $opt['system']['maillog']['column']['host_name'] = 'host_name'; // 'FromHost'
129
-$opt['system']['maillog']['column']['message'] = 'message';     // 'Message'
130
-$opt['system']['maillog']['column']['program'] = 'program';     // 'SysLogTag'
131
-$opt['system']['maillog']['inactivity_warning'] = 30;   // warn after N days without new entries
129
+$opt['system']['maillog']['column']['message'] = 'message'; // 'Message'
130
+$opt['system']['maillog']['column']['program'] = 'program'; // 'SysLogTag'
131
+$opt['system']['maillog']['inactivity_warning'] = 30; // warn after N days without new entries
132 132
 
133 133
 /* cookie or session
134 134
  *
@@ -150,15 +150,15 @@  discard block
 block discarded – undo
150 150
  *
151 151
  * other parameters may be customized
152 152
  */
153
-$opt['session']['mode'] = SAVE_COOKIE;     // don't change - other option "SAVE_SESSION" is not implemented properly
153
+$opt['session']['mode'] = SAVE_COOKIE; // don't change - other option "SAVE_SESSION" is not implemented properly
154 154
 $opt['session']['cookiename'] = 'ocvagrant'; // only with SAVE_COOKIE
155 155
 $opt['session']['path'] = '/';
156
-$opt['session']['domain'] = '';    // may be overwritten by $opt['domain'][...]['cookiedomain']
156
+$opt['session']['domain'] = ''; // may be overwritten by $opt['domain'][...]['cookiedomain']
157 157
 
158 158
 /* maximum session lifetime
159 159
  */
160 160
 $opt['session']['expire']['cookie'] = 31536000; // when cookies used (default 1 year)
161
-$opt['session']['expire']['url'] = 1800;        // when no cookies used (default 30 min since last call), attention to session.js
161
+$opt['session']['expire']['url'] = 1800; // when no cookies used (default 30 min since last call), attention to session.js
162 162
 
163 163
 /* If the Referer was sent by the client and the substring was not found,
164 164
  * the embedded session id will be marked as invalid.
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 /* other template options
185 185
  *
186 186
  */
187
-$opt['page']['origin_url'] = 'https://www.opencaching.de/';  // production installation for this OC site
187
+$opt['page']['origin_url'] = 'https://www.opencaching.de/'; // production installation for this OC site
188 188
 $opt['page']['develsystem'] = false;
189 189
 $opt['page']['teampic_url'] = 'https://www.opencaching.de/images/team/';
190 190
 $opt['page']['teammember_url'] = 'https://www.opencaching.de/';
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
     'newcaches' => [
219 219
         'show' => true,
220 220
         'url' => 'https://www.opencaching.de',
221
-        'urlname' => '',  // optional: show other name than the url-domain
221
+        'urlname' => '', // optional: show other name than the url-domain
222 222
     ],
223 223
 ];
224 224
 
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 
379 379
 /* license-related functions
380 380
  */
381
-$opt['logic']['license']['newusers'] = 2;  // see license constants in lib2/logic/const.inc.php
381
+$opt['logic']['license']['newusers'] = 2; // see license constants in lib2/logic/const.inc.php
382 382
 $opt['logic']['license']['admin'] = true;
383 383
 $opt['logic']['license']['disclaimer'] = false;
384 384
 $opt['logic']['license']['terms'] = 'articles.php?page=impressum#datalicense';
@@ -386,18 +386,18 @@  discard block
 block discarded – undo
386 386
 
387 387
 /* optional APIs
388 388
  */
389
-$opt['logic']['api']['email_problems']['key'] = '';   // must be set to enable
390
-$opt['logic']['api']['user_inactivity']['key'] = '';  // must be set to enable
389
+$opt['logic']['api']['email_problems']['key'] = ''; // must be set to enable
390
+$opt['logic']['api']['user_inactivity']['key'] = ''; // must be set to enable
391 391
 
392 392
 /* cache report info settings
393 393
  */
394 394
 $opt['logic']['cache_reports']['delaydays'] = 2;
395
-$opt['logic']['cache_reports']['min_processperday'] = 5;   // set to 0 to disable
396
-$opt['logic']['cache_reports']['max_processperday'] = 20;  // set to 0 to disable
395
+$opt['logic']['cache_reports']['min_processperday'] = 5; // set to 0 to disable
396
+$opt['logic']['cache_reports']['max_processperday'] = 20; // set to 0 to disable
397 397
 
398 398
 /* cronjob
399 399
  */
400
-$opt['cron']['username'] = 'apache';   // system username for cronjobs
400
+$opt['cron']['username'] = 'apache'; // system username for cronjobs
401 401
 
402 402
 /* generate sitemap.xml and upload to search engines
403 403
  *
Please login to merge, or discard this patch.
htdocs/src/Oc/Page/PageRepository.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
         if (count($where) > 0) {
54 54
             foreach ($where as $column => $value) {
55
-                $queryBuilder->andWhere($column . ' = ' .  $queryBuilder->createNamedParameter($value));
55
+                $queryBuilder->andWhere($column . ' = ' . $queryBuilder->createNamedParameter($value));
56 56
             }
57 57
         }
58 58
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             $databaseArray
90 90
         );
91 91
 
92
-        $entity->id = (int) $this->connection->lastInsertId();
92
+        $entity->id = (int)$this->connection->lastInsertId();
93 93
 
94 94
         return $entity;
95 95
     }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             ['id' => $entity->id]
118 118
         );
119 119
 
120
-        $entity->id = (int) $this->connection->lastInsertId();
120
+        $entity->id = (int)$this->connection->lastInsertId();
121 121
 
122 122
         return $entity;
123 123
     }
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
     public function getEntityFromDatabaseArray(array $data)
181 181
     {
182 182
         $entity = new PageEntity();
183
-        $entity->id = (int) $data['id'];
184
-        $entity->slug = (string) $data['slug'];
185
-        $entity->metaKeywords = (string) $data['meta_keywords'];
186
-        $entity->metaDescription = (string) $data['meta_description'];
187
-        $entity->metaSocial = (string) $data['meta_social'];
183
+        $entity->id = (int)$data['id'];
184
+        $entity->slug = (string)$data['slug'];
185
+        $entity->metaKeywords = (string)$data['meta_keywords'];
186
+        $entity->metaDescription = (string)$data['meta_description'];
187
+        $entity->metaSocial = (string)$data['meta_social'];
188 188
         $entity->updatedAt = new DateTime($data['updated_at']);
189
-        $entity->active = (bool) $data['active'];
189
+        $entity->active = (bool)$data['active'];
190 190
 
191 191
         return $entity;
192 192
     }
Please login to merge, or discard this patch.
htdocs/src/Oc/Country/CountryRepository.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -175,15 +175,15 @@
 block discarded – undo
175 175
     public function getEntityFromDatabaseArray(array $data)
176 176
     {
177 177
         $entity = new CountryEntity();
178
-        $entity->short = (string) $data['short'];
179
-        $entity->name = (string) $data['name'];
180
-        $entity->de = (string) $data['de'];
181
-        $entity->en = (string) $data['en'];
182
-        $entity->translationId = (int) $data['trans_id'];
183
-        $entity->listDefaultDe = (bool) $data['list_default_de'];
184
-        $entity->listDefaultEn = (bool) $data['list_default_en'];
185
-        $entity->sortDe = (string) $data['sort_de'];
186
-        $entity->sortEn = (string) $data['sort_en'];
178
+        $entity->short = (string)$data['short'];
179
+        $entity->name = (string)$data['name'];
180
+        $entity->de = (string)$data['de'];
181
+        $entity->en = (string)$data['en'];
182
+        $entity->translationId = (int)$data['trans_id'];
183
+        $entity->listDefaultDe = (bool)$data['list_default_de'];
184
+        $entity->listDefaultEn = (bool)$data['list_default_en'];
185
+        $entity->sortDe = (string)$data['sort_de'];
186
+        $entity->sortEn = (string)$data['sort_en'];
187 187
 
188 188
         return $entity;
189 189
     }
Please login to merge, or discard this patch.
htdocs/src/Oc/User/UserRepository.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             $databaseArray
104 104
         );
105 105
 
106
-        $entity->id = (int) $this->connection->lastInsertId();
106
+        $entity->id = (int)$this->connection->lastInsertId();
107 107
 
108 108
         return $entity;
109 109
     }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             ['id' => $entity->id]
132 132
         );
133 133
 
134
-        $entity->id = (int) $this->connection->lastInsertId();
134
+        $entity->id = (int)$this->connection->lastInsertId();
135 135
 
136 136
         return $entity;
137 137
     }
@@ -216,16 +216,16 @@  discard block
 block discarded – undo
216 216
     public function getEntityFromDatabaseArray(array $data)
217 217
     {
218 218
         $entity = new UserEntity();
219
-        $entity->id = (int) $data['user_id'];
220
-        $entity->username = (string) $data['username'];
221
-        $entity->password = (string) $data['password'];
222
-        $entity->email = (string) $data['email'];
223
-        $entity->latitude = (double) $data['latitude'];
224
-        $entity->longitude = (double) $data['longitude'];
225
-        $entity->isActive = (bool) $data['is_active_flag'];
226
-        $entity->firstname = (string) $data['first_name'];
227
-        $entity->lastname = (string) $data['last_name'];
228
-        $entity->country = (string) $data['country'];
219
+        $entity->id = (int)$data['user_id'];
220
+        $entity->username = (string)$data['username'];
221
+        $entity->password = (string)$data['password'];
222
+        $entity->email = (string)$data['email'];
223
+        $entity->latitude = (double)$data['latitude'];
224
+        $entity->longitude = (double)$data['longitude'];
225
+        $entity->isActive = (bool)$data['is_active_flag'];
226
+        $entity->firstname = (string)$data['first_name'];
227
+        $entity->lastname = (string)$data['last_name'];
228
+        $entity->country = (string)$data['country'];
229 229
         $entity->language = strtolower($data['language']);
230 230
 
231 231
         return $entity;
Please login to merge, or discard this patch.