Test Failed
Push — trunk ( 769658...cc4c01 )
by SuperNova.WS
15:09
created
classes/debug.php 2 patches
Spacing   +39 added lines, -40 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  * que esperabas!!! soy newbie!!! D':<
26 26
 */
27 27
 
28
-if(!defined('INSIDE')) {
28
+if (!defined('INSIDE')) {
29 29
   die("attemp hacking");
30 30
 }
31 31
 
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
     $result = array();
85 85
     $transaction_id = SN::db_transaction_check(false) ? SN::$transaction_id : SN::$transaction_id++;
86 86
     $result[] = "tID {$transaction_id}";
87
-    foreach($backtrace as $a_trace) {
88
-      if(in_array($a_trace['function'], $exclude_functions)) {
87
+    foreach ($backtrace as $a_trace) {
88
+      if (in_array($a_trace['function'], $exclude_functions)) {
89 89
         continue;
90 90
       }
91 91
       $function =
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
       $line = !empty($a_trace['line']) ? $a_trace['line'] : '_UNDEFINED_';
103 103
       $result[] = "{$function} - '{$file}' Line {$line}";
104 104
 
105
-      if(!$long_comment) {
105
+      if (!$long_comment) {
106 106
         break;
107 107
       }
108 108
     }
@@ -111,26 +111,26 @@  discard block
 block discarded – undo
111 111
   }
112 112
 
113 113
   function dump($dump = false, $force_base = false, $deadlock = false) {
114
-    if($dump === false) {
114
+    if ($dump === false) {
115 115
       return [];
116 116
     }
117 117
 
118 118
     $error_backtrace = array();
119 119
     $base_dump = false;
120 120
 
121
-    if($force_base === true) {
121
+    if ($force_base === true) {
122 122
       $base_dump = true;
123 123
     }
124 124
 
125
-    if($dump === true) {
125
+    if ($dump === true) {
126 126
       $base_dump = true;
127 127
     } else {
128
-      if(!is_array($dump)) {
128
+      if (!is_array($dump)) {
129 129
         $dump = array('var' => $dump);
130 130
       }
131 131
 
132
-      foreach($dump as $dump_var_name => $dump_var) {
133
-        if($dump_var_name == 'base_dump') {
132
+      foreach ($dump as $dump_var_name => $dump_var) {
133
+        if ($dump_var_name == 'base_dump') {
134 134
           $base_dump = $dump_var;
135 135
         } else {
136 136
           $error_backtrace[$dump_var_name] = $dump_var;
@@ -138,24 +138,23 @@  discard block
 block discarded – undo
138 138
       }
139 139
     }
140 140
 
141
-    if($deadlock && ($q = SN::$db->mysql_get_innodb_status())) {
141
+    if ($deadlock && ($q = SN::$db->mysql_get_innodb_status())) {
142 142
       $error_backtrace['deadlock'] = explode("\n", $q['Status']);
143 143
       $error_backtrace['locks'] = _SnCacheInternal::$locks;
144 144
       $error_backtrace['cSN_data'] = _SnCacheInternal::$data;
145
-      foreach($error_backtrace['cSN_data'] as &$location) {
146
-        foreach($location as $location_id => &$location_data) //          $location_data = $location_id;
145
+      foreach ($error_backtrace['cSN_data'] as &$location) {
146
+        foreach ($location as $location_id => &$location_data) //          $location_data = $location_id;
147 147
         {
148
-          $location_data = isset($location_data['username']) ? $location_data['username'] :
149
-            (isset($location_data['name']) ? $location_data['name'] : $location_id);
148
+          $location_data = isset($location_data['username']) ? $location_data['username'] : (isset($location_data['name']) ? $location_data['name'] : $location_id);
150 149
         }
151 150
       }
152 151
     }
153 152
 
154
-    if($base_dump) {
155
-      if(!is_array($this->log_array) || empty($this->log_array)) {
153
+    if ($base_dump) {
154
+      if (!is_array($this->log_array) || empty($this->log_array)) {
156 155
         $this->log_array = [];
157 156
       } else {
158
-        foreach($this->log_array as $log) {
157
+        foreach ($this->log_array as $log) {
159 158
           $error_backtrace['queries'][] = $log;
160 159
         }
161 160
       }
@@ -167,17 +166,17 @@  discard block
 block discarded – undo
167 166
       // Converting object instances to object names
168 167
 
169 168
       foreach ($error_backtrace['backtrace'] as &$backtrace) {
170
-        if(is_object($backtrace['object'])) {
169
+        if (is_object($backtrace['object'])) {
171 170
           $backtrace['object'] = get_class($backtrace['object']);
172 171
         }
173 172
 
174
-        if(empty($backtrace['args'])) {
173
+        if (empty($backtrace['args'])) {
175 174
           continue;
176 175
         }
177 176
 
178 177
         // Doing same conversion for backtrace params
179
-        foreach($backtrace['args'] as &$arg) {
180
-          if(is_object($arg)) {
178
+        foreach ($backtrace['args'] as &$arg) {
179
+          if (is_object($arg)) {
181 180
             $arg = 'object::' . get_class($arg);
182 181
           }
183 182
         }
@@ -206,14 +205,14 @@  discard block
 block discarded – undo
206 205
   function error($message = 'There is a error on page', $title = 'Internal Error', $httpCode = 500, $dump = true) {
207 206
     global $config, $sys_stop_log_hit, $lang, $sys_log_disabled, $user;
208 207
 
209
-    if(empty(SN::$db->connected)) {
208
+    if (empty(SN::$db->connected)) {
210 209
       // TODO - писать ошибку в файл
211 210
       die('SQL server currently unavailable. Please contact Administration...');
212 211
     }
213 212
 
214 213
     SN::db_transaction_rollback();
215 214
 
216
-    if(SN::$config->debug == 1) {
215
+    if (SN::$config->debug == 1) {
217 216
       /** @noinspection HtmlDeprecatedTag */
218 217
       /** @noinspection XmlDeprecatedElement */
219 218
       /** @noinspection HtmlDeprecatedAttribute */
@@ -226,7 +225,7 @@  discard block
 block discarded – undo
226 225
     $error_text = SN::$db->db_escape($message);
227 226
     $error_backtrace = $this->dump($dump, true, strpos($message, 'Deadlock') !== false);
228 227
 
229
-    if(!$sys_log_disabled) {
228
+    if (!$sys_log_disabled) {
230 229
       $this->_writeLogMessage($httpCode, $user, $title, $message, $error_backtrace, $fatal_error);
231 230
 
232 231
       $message = "Пожалуйста, свяжитесь с админом, если ошибка повторится. Ошибка №: <b>" . SN::$db->db_insert_id() . "</b>";
@@ -239,7 +238,7 @@  discard block
 block discarded – undo
239 238
       ob_start();
240 239
       print("<hr>User ID {$user['id']} raised error code {$httpCode} titled '{$title}' with text '{$error_text}' on page {$_SERVER['SCRIPT_NAME']}");
241 240
 
242
-      foreach($error_backtrace as $name => $value) {
241
+      foreach ($error_backtrace as $name => $value) {
243 242
         print('<hr>');
244 243
         pdump($value, $name);
245 244
       }
@@ -251,7 +250,7 @@  discard block
 block discarded – undo
251 250
   function warning($message, $title = 'System Message', $httpCode = 300, $dump = false) {
252 251
     global $user, $lang, $sys_log_disabled;
253 252
 
254
-    if(empty(SN::$db->connected)) {
253
+    if (empty(SN::$db->connected)) {
255 254
       // TODO - писать ошибку в файл
256 255
       die('SQL server currently unavailable. Please contact Administration...');
257 256
     }
@@ -260,7 +259,7 @@  discard block
 block discarded – undo
260 259
 
261 260
     $error_backtrace = $this->dump($dump, false);
262 261
 
263
-    if(empty($sys_log_disabled)) {
262
+    if (empty($sys_log_disabled)) {
264 263
       $this->_writeLogMessage($httpCode, $user, $title, $message, $error_backtrace, $fatal_error);
265 264
     } else {
266 265
 //        // TODO Здесь надо писать в файло
@@ -297,11 +296,11 @@  discard block
 block discarded – undo
297 296
 // Dump variables nicer then var_dump()
298 297
 
299 298
 function dump($value, $varname = null, $level = 0, $dumper = '') {
300
-  if(isset($varname)) {
299
+  if (isset($varname)) {
301 300
     $varname .= " = ";
302 301
   }
303 302
 
304
-  if($level == -1) {
303
+  if ($level == -1) {
305 304
     $trans[' '] = '&there4;';
306 305
     $trans["\t"] = '&rArr;';
307 306
     $trans["\n"] = '&para;;';
@@ -310,7 +309,7 @@  discard block
 block discarded – undo
310 309
 
311 310
     return strtr(htmlspecialchars($value), $trans);
312 311
   }
313
-  if($level == 0) {
312
+  if ($level == 0) {
314 313
 //    $dumper = '<pre>' . mt_rand(10, 99) . '|' . $varname;
315 314
     $dumper = mt_rand(10, 99) . '|' . $varname;
316 315
   }
@@ -318,22 +317,22 @@  discard block
 block discarded – undo
318 317
   $type = gettype($value);
319 318
   $dumper .= $type;
320 319
 
321
-  if($type == 'string') {
320
+  if ($type == 'string') {
322 321
     $dumper .= '(' . strlen($value) . ')';
323 322
     $value = dump($value, '', -1);
324
-  } elseif($type == 'boolean') {
323
+  } elseif ($type == 'boolean') {
325 324
     $value = ($value ? 'true' : 'false');
326
-  } elseif($type == 'object') {
325
+  } elseif ($type == 'object') {
327 326
     $props = get_class_vars(get_class($value));
328 327
     $dumper .= '(' . count($props) . ') <u>' . get_class($value) . '</u>';
329
-    foreach($props as $key => $val) {
328
+    foreach ($props as $key => $val) {
330 329
       $dumper .= "\n" . str_repeat("\t", $level + 1) . $key . ' => ';
331 330
       $dumper .= dump($value->$key, '', $level + 1);
332 331
     }
333 332
     $value = '';
334
-  } elseif($type == 'array') {
333
+  } elseif ($type == 'array') {
335 334
     $dumper .= '(' . count($value) . ')';
336
-    foreach($value as $key => $val) {
335
+    foreach ($value as $key => $val) {
337 336
       $dumper .= "\n" . str_repeat("\t", $level + 1) . dump($key, '', -1) . ' => ';
338 337
       $dumper .= dump($val, '', $level + 1);
339 338
     }
@@ -353,7 +352,7 @@  discard block
 block discarded – undo
353 352
 //  $backtrace = $backtrace[1];
354 353
 
355 354
   $caller = '';
356
-  if(defined('SN_DEBUG_PDUMP_CALLER') && SN_DEBUG_PDUMP_CALLER) {
355
+  if (defined('SN_DEBUG_PDUMP_CALLER') && SN_DEBUG_PDUMP_CALLER) {
357 356
     $caller = (!empty($backtrace[1]['class']) ? $backtrace[1]['class'] : '') .
358 357
       (!empty($backtrace[1]['type']) ? $backtrace[1]['type'] : '') .
359 358
       $backtrace[1]['function'] .
@@ -380,7 +379,7 @@  discard block
 block discarded – undo
380 379
 }
381 380
 
382 381
 function pr($prePrint = false) {
383
-  if($prePrint) {
382
+  if ($prePrint) {
384 383
     print("<br>");
385 384
   }
386 385
   print(mt_rand() . "<br>");
@@ -390,7 +389,7 @@  discard block
 block discarded – undo
390 389
   global $_PRINT_COUNT_VALUE;
391 390
   $_PRINT_COUNT_VALUE++;
392 391
 
393
-  if($prePrint) {
392
+  if ($prePrint) {
394 393
     print("<br>");
395 394
   }
396 395
   print($_PRINT_COUNT_VALUE . "<br>");
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -143,11 +143,13 @@  discard block
 block discarded – undo
143 143
       $error_backtrace['locks'] = _SnCacheInternal::$locks;
144 144
       $error_backtrace['cSN_data'] = _SnCacheInternal::$data;
145 145
       foreach($error_backtrace['cSN_data'] as &$location) {
146
-        foreach($location as $location_id => &$location_data) //          $location_data = $location_id;
146
+        foreach($location as $location_id => &$location_data) {
147
+          //          $location_data = $location_id;
147 148
         {
148 149
           $location_data = isset($location_data['username']) ? $location_data['username'] :
149 150
             (isset($location_data['name']) ? $location_data['name'] : $location_id);
150 151
         }
152
+        }
151 153
       }
152 154
     }
153 155
 
@@ -278,8 +280,7 @@  discard block
 block discarded – undo
278 280
    *
279 281
    * @return void
280 282
    */
281
-  function _writeLogMessage($httpCode, $user, $title, $message, array $error_backtrace, $fatal_error)
282
-  {
283
+  function _writeLogMessage($httpCode, $user, $title, $message, array $error_backtrace, $fatal_error) {
283 284
     /** @noinspection SqlResolve */
284 285
     $query = "INSERT INTO `{{logs}}` SET
285 286
         `log_time` = '" . time() . "', `log_code` = '" . SN::$db->db_escape($httpCode) . "', " .
Please login to merge, or discard this patch.
classes/Template/TemplateMeta.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@
 block discarded – undo
136 136
 //    var_dump($fallBackPath);
137 137
 //    var_dump($template);
138 138
 
139
-    if(empty($fallBackPath)) {
139
+    if (empty($fallBackPath)) {
140 140
       if (!$this->parent || empty($fallbackName = $this->parent->getName()) || !$this->isTemplateExists()) {
141 141
         // If no parent template - then using default template as fallback one
142 142
         $fallbackName = SnTemplate::SN_TEMPLATE_NAME_DEFAULT;
Please login to merge, or discard this patch.
classes/classPersistent.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     $this->sql_index_field = "{$table_name}_name";
41 41
     $this->sql_value_field = "{$table_name}_value";
42 42
 
43
-    if(!$this->_DB_LOADED) {
43
+    if (!$this->_DB_LOADED) {
44 44
       $this->db_loadAll();
45 45
     }
46 46
   }
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
    */
61 61
   public function db_loadItem($index) {
62 62
     $result = null;
63
-    if($index) {
63
+    if ($index) {
64 64
       $index_safe = SN::$db->db_escape($index);
65 65
       $queryResult = doquery("SELECT `{$this->sql_value_field}` FROM `{{{$this->table_name}}}` WHERE `{$this->sql_index_field}` = '{$index_safe}' FOR UPDATE", true);
66
-      if(is_array($queryResult) && !empty($queryResult)) {
66
+      if (is_array($queryResult) && !empty($queryResult)) {
67 67
         $this->$index = $result = $queryResult[$this->sql_value_field];
68 68
       }
69 69
     }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     $this->loadDefaults();
76 76
 
77 77
     $query = doquery("SELECT * FROM {{{$this->table_name}}} FOR UPDATE;");
78
-    while($row = db_fetch($query)) {
78
+    while ($row = db_fetch($query)) {
79 79
       $this[$row[$this->sql_index_field]] = $row[$this->sql_value_field];
80 80
     }
81 81
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
   }
84 84
 
85 85
   public function loadDefaults() {
86
-    foreach($this->defaults as $defName => $defValue) {
86
+    foreach ($this->defaults as $defName => $defValue) {
87 87
       $this->$defName = $defValue;
88 88
     }
89 89
   }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
   }
94 94
 
95 95
   public function db_saveItem($item_list, $value = NULL) {
96
-    if(empty($item_list)) {
96
+    if (empty($item_list)) {
97 97
       return;
98 98
     }
99 99
 
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 
102 102
     // Сначала записываем данные в базу - что бы поймать все блокировки
103 103
     $qry = array();
104
-    foreach($item_list as $item_name => $item_value) {
105
-      if($item_name) {
104
+    foreach ($item_list as $item_name => $item_value) {
105
+      if ($item_name) {
106 106
         $item_value = SN::$db->db_escape($item_value === NULL ? $this->$item_name : $item_value);
107 107
         $item_name = SN::$db->db_escape($item_name);
108 108
         $qry[] = "('{$item_name}', '{$item_value}')";
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
     doquery("REPLACE INTO `{{" . $this->table_name . "}}` (`{$this->sql_index_field}`, `{$this->sql_value_field}`) VALUES " . implode(',', $qry) . ";");
112 112
 
113 113
     // И только после взятия блокировок - меняем значения в кэше
114
-    foreach($item_list as $item_name => $item_value) {
115
-      if($item_name && $item_value !== null) {
114
+    foreach ($item_list as $item_name => $item_value) {
115
+      if ($item_name && $item_value !== null) {
116 116
         $this->__set($item_name, $item_value);
117 117
       }
118 118
     }
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
   }
141 141
 
142 142
   public function __get($name) {
143
-    if($this->force) {
143
+    if ($this->force) {
144 144
       $this->force = false;
145 145
       $value = $this->db_loadItem($name);
146 146
     } else {
147 147
       $value = parent::__get($name);
148 148
     }
149 149
 
150
-    if(isset($this->notEmptyFields[$name]) && empty($value) && isset($this->defaults[$name])) {
150
+    if (isset($this->notEmptyFields[$name]) && empty($value) && isset($this->defaults[$name])) {
151 151
       $value = $this->defaults[$name];
152 152
     }
153 153
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
   }
156 156
 
157 157
   public function __set($name, $value) {
158
-    if($this->force) {
158
+    if ($this->force) {
159 159
       $this->force = false;
160 160
       $this->db_saveItem($name, $value);
161 161
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     $this->db_saveItem(array_combine(array_keys($this->defaults), array_fill(0, count($this->defaults), null)));
93 93
   }
94 94
 
95
-  public function db_saveItem($item_list, $value = NULL) {
95
+  public function db_saveItem($item_list, $value = null) {
96 96
     if(empty($item_list)) {
97 97
       return;
98 98
     }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     $qry = array();
104 104
     foreach($item_list as $item_name => $item_value) {
105 105
       if($item_name) {
106
-        $item_value = SN::$db->db_escape($item_value === NULL ? $this->$item_name : $item_value);
106
+        $item_value = SN::$db->db_escape($item_value === null ? $this->$item_name : $item_value);
107 107
         $item_name = SN::$db->db_escape($item_name);
108 108
         $qry[] = "('{$item_name}', '{$item_value}')";
109 109
       }
Please login to merge, or discard this patch.
classes/DBAL/OldDbChangeSet.php 1 patch
Spacing   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -142,9 +142,7 @@
 block discarded – undo
142 142
           // Простое условие - $field_id = $field_value
143 143
           if (is_string($field_id)) {
144 144
             $field_value =
145
-              $field_value === null ? 'NULL' :
146
-                (is_string($field_value) ? "'" . SN::$db->db_escape($field_value) . "'" :
147
-                  (is_bool($field_value) ? intval($field_value) : $field_value));
145
+              $field_value === null ? 'NULL' : (is_string($field_value) ? "'" . SN::$db->db_escape($field_value) . "'" : (is_bool($field_value) ? intval($field_value) : $field_value));
148 146
             $the_conditions[] = "`{$field_id}` = {$field_value}";
149 147
           } else {
150 148
             die('Неподдерживаемый тип условия');
Please login to merge, or discard this patch.
classes/DBAL/db_mysql.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 
225 225
     set_error_handler([$this, 'handlerQueryWarning']);
226 226
     $sqlquery = $this->db_sql_query($sql);
227
-    if(!$sqlquery) {
227
+    if (!$sqlquery) {
228 228
       $debug->error(SN::$db->db_error() . "<br />$sql<br />", 'SQL Error');
229 229
     }
230 230
     restore_error_handler();
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
     $q1 = $this->db_sql_query("SHOW INDEX FROM {$prefixedTableName_safe};");
397 397
     while ($r1 = db_fetch($q1)) {
398 398
       $indexName = $r1['Key_name'];
399
-      if(empty($result[$indexName])) {
399
+      if (empty($result[$indexName])) {
400 400
         $result[$indexName] = new DbIndexDescription();
401 401
       }
402 402
       $result[$indexName]->addField($r1);
Please login to merge, or discard this patch.
classes/StatUpdateLauncher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
         $config->pass()->game_disable = GAME_DISABLE_STAT;
57 57
 
58 58
         $statMinimalInterval = intval($config->pass()->stats_minimal_interval);
59
-        $config->pass()->var_stat_update_end= date(FMT_DATE_TIME_SQL, SN_TIME_NOW + ($statMinimalInterval ? $statMinimalInterval : STATS_RUN_INTERVAL_MINIMUM));
59
+        $config->pass()->var_stat_update_end = date(FMT_DATE_TIME_SQL, SN_TIME_NOW + ($statMinimalInterval ? $statMinimalInterval : STATS_RUN_INTERVAL_MINIMUM));
60 60
         $config->pass()->var_stat_update_msg = 'Update started';
61 61
         SN::db_transaction_commit();
62 62
 
Please login to merge, or discard this patch.
classes/SnTemplate.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         $insert_position = $is_positioned == '-' ? 0 : count($menu);
129 129
       }
130 130
 
131
-      $insert_position     += $is_positioned == '+' ? 1 : 0;
131
+      $insert_position += $is_positioned == '+' ? 1 : 0;
132 132
       $spliced             = array_splice($menu, $insert_position, count($menu) - $insert_position);
133 133
       $menu[$menu_item_id] = $menu_item;
134 134
 
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
       'LANG'     => $language ? $language : '',
649 649
       'referral' => $id_ref ? '&id_ref=' . $id_ref : '',
650 650
 
651
-      'REQUEST_PARAMS' => !empty($url_params) ? '?' . implode('&', $url_params) : '',// "?lang={$language}" . ($id_ref ? "&id_ref={$id_ref}" : ''),
651
+      'REQUEST_PARAMS' => !empty($url_params) ? '?' . implode('&', $url_params) : '', // "?lang={$language}" . ($id_ref ? "&id_ref={$id_ref}" : ''),
652 652
       'FILENAME'       => basename($_SERVER['PHP_SELF']),
653 653
     ));
654 654
 
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
       }
837 837
 
838 838
       $fleet_listx = flt_get_fleets_to_planet($CurPlanet);
839
-      if($CurPlanet['planet_type'] == PT_MOON) {
839
+      if ($CurPlanet['planet_type'] == PT_MOON) {
840 840
         $parentPlanet = DBStaticPlanet::db_planet_by_id($CurPlanet['parent_planet']);
841 841
       } else {
842 842
         $parentPlanet = $CurPlanet;
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
       'QUE_ID'   => QUE_RESEARCH,
882 882
       'QUE_HTML' => 'topnav',
883 883
 
884
-      'RESEARCH_ONGOING' => (boolean)$user['que'],
884
+      'RESEARCH_ONGOING' => (boolean) $user['que'],
885 885
 
886 886
       'TIME_TEXT'       => sprintf($str_date_format, $time_now_parsed['year'], $lang['months'][$time_now_parsed['mon']], $time_now_parsed['mday'],
887 887
         $time_now_parsed['hours'], $time_now_parsed['minutes'], $time_now_parsed['seconds']
@@ -1171,7 +1171,7 @@  discard block
 block discarded – undo
1171 1171
       SnTemplate::renderFooter($page, $template_result);
1172 1172
     }
1173 1173
 
1174
-    $user['authlevel'] >= 3 && $config->debug ? $debug->echo_log() : false;;
1174
+    $user['authlevel'] >= 3 && $config->debug ? $debug->echo_log() : false; ;
1175 1175
 
1176 1176
     SN::$db->db_disconnect();
1177 1177
 
Please login to merge, or discard this patch.
galaxy.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
   $planet = $planetrow['planet'];
66 66
 }
67 67
 
68
-$uni_galaxy = (int)$uni_galaxy;
69
-$uni_system = (int)$uni_system;
68
+$uni_galaxy = (int) $uni_galaxy;
69
+$uni_system = (int) $uni_system;
70 70
 
71 71
 $uni_galaxy = $uni_galaxy < 1 ? 1 : ($uni_galaxy > SN::$config->game_maxGalaxy ? SN::$config->game_maxGalaxy : $uni_galaxy);
72 72
 $uni_system = $uni_system < 1 ? 1 : ($uni_system > SN::$config->game_maxSystem ? SN::$config->game_maxSystem : $uni_system);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     ||
132 132
     (!empty($uni_galaxyRowPlanet['destruyed']) && CheckAbandonPlanetState($uni_galaxyRowPlanet))
133 133
   ) {
134
-    $template->assign_block_vars('galaxyrow', ['PLANET_NUM' => $Planet,]);
134
+    $template->assign_block_vars('galaxyrow', ['PLANET_NUM' => $Planet, ]);
135 135
     continue;
136 136
   }
137 137
 
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
     'IS_CAPITAL'      => $uni_galaxyRowUser['id_planet'] == $uni_galaxyRowPlanet['id'],
250 250
 
251 251
     'USER_ID'         => $uni_galaxyRowUser['id'],
252
-    'USER_NAME'       => $renderedNick = player_nick_render_to_html($uni_galaxyRowUser, ['icons' => true,]),
252
+    'USER_NAME'       => $renderedNick = player_nick_render_to_html($uni_galaxyRowUser, ['icons' => true, ]),
253 253
     'USER_NAME_JS'    => js_safe_string($renderedNick),
254 254
     'USER_RANK'       => in_array($uni_galaxyRowUser['id'], $user_skip_list) ? '-' : $uni_galaxyRowUser['total_rank'],
255 255
     'USER_BANNED'     => $uni_galaxyRowUser['banaday'],
Please login to merge, or discard this patch.
includes/db/db_helpers.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,19 +29,19 @@  discard block
 block discarded – undo
29 29
  */
30 30
 function db_set_make_safe_string($set, $delta = false) {
31 31
   $set_safe = array();
32
-  foreach($set as $field => $value) {
33
-    if(empty($field)) {
32
+  foreach ($set as $field => $value) {
33
+    if (empty($field)) {
34 34
       continue;
35 35
     }
36 36
 
37 37
     $field = '`' . SN::$db->db_escape($field) . '`';
38 38
     $new_value = $value;
39
-    if($value === null) {
39
+    if ($value === null) {
40 40
       $new_value = 'NULL';
41
-    } elseif(is_string($value) && (string)($new_value = floatval($value)) != (string)$value) {
41
+    } elseif (is_string($value) && (string) ($new_value = floatval($value)) != (string) $value) {
42 42
       // non-float
43 43
       $new_value = '"' . SN::$db->db_escape($value) . '"';
44
-    } elseif($delta) {
44
+    } elseif ($delta) {
45 45
       // float and DELTA-set
46 46
       $new_value = "{$field} + ({$new_value})";
47 47
     }
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
  */
62 62
 function missile_list_convert_to_fleet(&$missile_db_list, &$fleet_db_list) {
63 63
   // Missile attack
64
-  foreach($missile_db_list as $irak) {
65
-    if($irak['fleet_end_time'] >= SN_TIME_NOW) {
64
+  foreach ($missile_db_list as $irak) {
65
+    if ($irak['fleet_end_time'] >= SN_TIME_NOW) {
66 66
       $irak['fleet_start_type'] = PT_PLANET;
67 67
       $planet_start = DBStaticPlanet::db_planet_by_vector($irak, 'fleet_start_', false, 'name');
68 68
       $irak['fleet_id'] = -$irak['id'];
Please login to merge, or discard this patch.