Test Failed
Push — trunk ( b76cfb...dfde47 )
by SuperNova.WS
03:49
created
classes/Ube/Ube4_1/Ube4_1Calc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
         // Для не-симулятора - рандомизируем каждый раунд значения атаки и щитов
73 73
         $fleet_data[UBE_ATTACK_BASE][$unit_id] = floor($fleet_info[UBE_ATTACK][$unit_id] * ($isSimulatorStatic ? 1 : mt_rand(80, 120) / 100));
74 74
         $fleet_data[UBE_SHIELD_BASE][$unit_id] = floor($fleet_info[UBE_SHIELD][$unit_id] * ($isSimulatorStatic ? 1 : mt_rand(80, 120) / 100));
75
-        $fleet_data[UBE_ARMOR_BASE][$unit_id] = floor($fleet_info[UBE_ARMOR][$unit_id]);// * ($is_simulator ? 1 : mt_rand(80, 120) / 100));
75
+        $fleet_data[UBE_ARMOR_BASE][$unit_id] = floor($fleet_info[UBE_ARMOR][$unit_id]); // * ($is_simulator ? 1 : mt_rand(80, 120) / 100));
76 76
 
77 77
         $fleet_data[UBE_ATTACK][$unit_id] = $fleet_data[UBE_ATTACK_BASE][$unit_id] * $unit_count;
78 78
         $fleet_data[UBE_SHIELD][$unit_id] = $fleet_data[UBE_SHIELD_BASE][$unit_id] * $unit_count;
Please login to merge, or discard this patch.
classes/Fleet/MissionExplore.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
    *
41 41
    * @var int[] $shipsToRemove
42 42
    */
43
-  protected $shipsToRemove = [SHIP_COLONIZER, SHIP_SPY,];
43
+  protected $shipsToRemove = [SHIP_COLONIZER, SHIP_SPY, ];
44 44
 
45 45
   // -------------------------------------------------------------------------------------------------------------------
46 46
   /**
Please login to merge, or discard this patch.
admin/userlist.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
 
86 86
   $template->assign_block_vars('user', array(
87 87
       'ID'              => $user_row['id'],
88
-      'NAME'            => $renderedNick = player_nick_render_to_html($user_row, ['player_rank' => true, 'vacancy' => true, 'birthday' => true, 'award' => true, NICK_RANK_NO_TEXT => true,]),
88
+      'NAME'            => $renderedNick = player_nick_render_to_html($user_row, ['player_rank' => true, 'vacancy' => true, 'birthday' => true, 'award' => true, NICK_RANK_NO_TEXT => true, ]),
89 89
       'NAME_HTML'       => htmlentities($user_row['username'], ENT_QUOTES, 'UTF-8'),
90 90
       'IP'              => $user_row['user_lastip'],
91 91
       'IP_MULTI'        => intval($multi_ip[$user_row['user_lastip']]),
Please login to merge, or discard this patch.
language/ru/buildings.mo.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,9 @@
 block discarded – undo
24 24
 * DO NOT CHANGE
25 25
 */
26 26
 
27
-if (!defined('INSIDE')) die();
27
+if (!defined('INSIDE')) {
28
+  die();
29
+}
28 30
 
29 31
 $a_lang_array = array(
30 32
   'built' => 'Построено',
Please login to merge, or discard this patch.
language/en/buildings.mo.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,9 @@
 block discarded – undo
26 26
 * DO NOT CHANGE
27 27
 */
28 28
 
29
-if (!defined('INSIDE')) die();
29
+if (!defined('INSIDE')) {
30
+  die();
31
+}
30 32
 
31 33
 
32 34
 $a_lang_array = array(
Please login to merge, or discard this patch.
classes/debug.php 3 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
 
81 81
     $result = array();
82 82
     $transaction_id = SN::db_transaction_check(false) ? SN::$transaction_id : SN::$transaction_id++;
83
-    $result[] = "tID {$transaction_id}";
83
+    $result[] = "tid {$transaction_id}";
84 84
     foreach($backtrace as $a_trace) {
85 85
       if(in_array($a_trace['function'], $exclude_functions)) {
86 86
         continue;
Please login to merge, or discard this patch.
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,22 +138,21 @@  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
-      foreach($error_backtrace['cSN_data'] as &$location) {
144
-        foreach($location as $location_id => &$location_data) //          $location_data = $location_id;
143
+      foreach ($error_backtrace['cSN_data'] as &$location) {
144
+        foreach ($location as $location_id => &$location_data) //          $location_data = $location_id;
145 145
         {
146
-          $location_data = isset($location_data['username']) ? $location_data['username'] :
147
-            (isset($location_data['name']) ? $location_data['name'] : $location_id);
146
+          $location_data = isset($location_data['username']) ? $location_data['username'] : (isset($location_data['name']) ? $location_data['name'] : $location_id);
148 147
         }
149 148
       }
150 149
     }
151 150
 
152
-    if($base_dump) {
153
-      if(!is_array($this->log_array) || empty($this->log_array)) {
151
+    if ($base_dump) {
152
+      if (!is_array($this->log_array) || empty($this->log_array)) {
154 153
         $this->log_array = [];
155 154
       } else {
156
-        foreach($this->log_array as $log) {
155
+        foreach ($this->log_array as $log) {
157 156
           $error_backtrace['queries'][] = $log;
158 157
         }
159 158
       }
@@ -165,17 +164,17 @@  discard block
 block discarded – undo
165 164
       // Converting object instances to object names
166 165
 
167 166
       foreach ($error_backtrace['backtrace'] as &$backtrace) {
168
-        if(is_object($backtrace['object'])) {
167
+        if (is_object($backtrace['object'])) {
169 168
           $backtrace['object'] = get_class($backtrace['object']);
170 169
         }
171 170
 
172
-        if(empty($backtrace['args'])) {
171
+        if (empty($backtrace['args'])) {
173 172
           continue;
174 173
         }
175 174
 
176 175
         // Doing same conversion for backtrace params
177
-        foreach($backtrace['args'] as &$arg) {
178
-          if(is_object($arg)) {
176
+        foreach ($backtrace['args'] as &$arg) {
177
+          if (is_object($arg)) {
179 178
             $arg = 'object::' . get_class($arg);
180 179
           }
181 180
         }
@@ -204,14 +203,14 @@  discard block
 block discarded – undo
204 203
   function error($message = 'There is a error on page', $title = 'Internal Error', $httpCode = 500, $dump = true) {
205 204
     global $config, $sys_stop_log_hit, $lang, $sys_log_disabled, $user;
206 205
 
207
-    if(empty(SN::$db->connected)) {
206
+    if (empty(SN::$db->connected)) {
208 207
       // TODO - писать ошибку в файл
209 208
       die('SQL server currently unavailable. Please contact Administration...');
210 209
     }
211 210
 
212 211
     SN::db_transaction_rollback();
213 212
 
214
-    if(SN::$config->debug == 1) {
213
+    if (SN::$config->debug == 1) {
215 214
       /** @noinspection HtmlDeprecatedTag */
216 215
       /** @noinspection XmlDeprecatedElement */
217 216
       /** @noinspection HtmlDeprecatedAttribute */
@@ -224,7 +223,7 @@  discard block
 block discarded – undo
224 223
     $error_text = SN::$db->db_escape($message);
225 224
     $error_backtrace = $this->dump($dump, true, strpos($message, 'Deadlock') !== false);
226 225
 
227
-    if(!$sys_log_disabled) {
226
+    if (!$sys_log_disabled) {
228 227
       $this->_writeLogMessage($httpCode, $user, $title, $message, $error_backtrace, $fatal_error);
229 228
 
230 229
       $message = "Пожалуйста, свяжитесь с админом, если ошибка повторится. Ошибка №: <b>" . SN::$db->db_insert_id() . "</b>";
@@ -237,7 +236,7 @@  discard block
 block discarded – undo
237 236
       ob_start();
238 237
       print("<hr>User ID {$user['id']} raised error code {$httpCode} titled '{$title}' with text '{$error_text}' on page {$_SERVER['SCRIPT_NAME']}");
239 238
 
240
-      foreach($error_backtrace as $name => $value) {
239
+      foreach ($error_backtrace as $name => $value) {
241 240
         print('<hr>');
242 241
         pdump($value, $name);
243 242
       }
@@ -249,7 +248,7 @@  discard block
 block discarded – undo
249 248
   function warning($message, $title = 'System Message', $httpCode = 300, $dump = false) {
250 249
     global $user, $lang, $sys_log_disabled;
251 250
 
252
-    if(empty(SN::$db->connected)) {
251
+    if (empty(SN::$db->connected)) {
253 252
       // TODO - писать ошибку в файл
254 253
       die('SQL server currently unavailable. Please contact Administration...');
255 254
     }
@@ -258,7 +257,7 @@  discard block
 block discarded – undo
258 257
 
259 258
     $error_backtrace = $this->dump($dump, false);
260 259
 
261
-    if(empty($sys_log_disabled)) {
260
+    if (empty($sys_log_disabled)) {
262 261
       $this->_writeLogMessage($httpCode, $user, $title, $message, $error_backtrace, $fatal_error);
263 262
     } else {
264 263
 //        // TODO Здесь надо писать в файло
@@ -295,11 +294,11 @@  discard block
 block discarded – undo
295 294
 // Dump variables nicer then var_dump()
296 295
 
297 296
 function dump($value, $varname = null, $level = 0, $dumper = '') {
298
-  if(isset($varname)) {
297
+  if (isset($varname)) {
299 298
     $varname .= " = ";
300 299
   }
301 300
 
302
-  if($level == -1) {
301
+  if ($level == -1) {
303 302
     $trans[' '] = '&there4;';
304 303
     $trans["\t"] = '&rArr;';
305 304
     $trans["\n"] = '&para;;';
@@ -308,7 +307,7 @@  discard block
 block discarded – undo
308 307
 
309 308
     return strtr(htmlspecialchars($value), $trans);
310 309
   }
311
-  if($level == 0) {
310
+  if ($level == 0) {
312 311
 //    $dumper = '<pre>' . mt_rand(10, 99) . '|' . $varname;
313 312
     $dumper = mt_rand(10, 99) . '|' . $varname;
314 313
   }
@@ -316,22 +315,22 @@  discard block
 block discarded – undo
316 315
   $type = gettype($value);
317 316
   $dumper .= $type;
318 317
 
319
-  if($type == 'string') {
318
+  if ($type == 'string') {
320 319
     $dumper .= '(' . strlen($value) . ')';
321 320
     $value = dump($value, '', -1);
322
-  } elseif($type == 'boolean') {
321
+  } elseif ($type == 'boolean') {
323 322
     $value = ($value ? 'true' : 'false');
324
-  } elseif($type == 'object') {
323
+  } elseif ($type == 'object') {
325 324
     $props = get_class_vars(get_class($value));
326 325
     $dumper .= '(' . count($props) . ') <u>' . get_class($value) . '</u>';
327
-    foreach($props as $key => $val) {
326
+    foreach ($props as $key => $val) {
328 327
       $dumper .= "\n" . str_repeat("\t", $level + 1) . $key . ' => ';
329 328
       $dumper .= dump($value->$key, '', $level + 1);
330 329
     }
331 330
     $value = '';
332
-  } elseif($type == 'array') {
331
+  } elseif ($type == 'array') {
333 332
     $dumper .= '(' . count($value) . ')';
334
-    foreach($value as $key => $val) {
333
+    foreach ($value as $key => $val) {
335 334
       $dumper .= "\n" . str_repeat("\t", $level + 1) . dump($key, '', -1) . ' => ';
336 335
       $dumper .= dump($val, '', $level + 1);
337 336
     }
@@ -351,7 +350,7 @@  discard block
 block discarded – undo
351 350
 //  $backtrace = $backtrace[1];
352 351
 
353 352
   $caller = '';
354
-  if(defined('SN_DEBUG_PDUMP_CALLER') && SN_DEBUG_PDUMP_CALLER) {
353
+  if (defined('SN_DEBUG_PDUMP_CALLER') && SN_DEBUG_PDUMP_CALLER) {
355 354
     $caller = (!empty($backtrace[1]['class']) ? $backtrace[1]['class'] : '') .
356 355
       (!empty($backtrace[1]['type']) ? $backtrace[1]['type'] : '') .
357 356
       $backtrace[1]['function'] .
@@ -386,7 +385,7 @@  discard block
 block discarded – undo
386 385
 }
387 386
 
388 387
 function pr($prePrint = false) {
389
-  if($prePrint) {
388
+  if ($prePrint) {
390 389
     print("<br>");
391 390
   }
392 391
   print(mt_rand() . "<br>");
@@ -396,7 +395,7 @@  discard block
 block discarded – undo
396 395
   global $_PRINT_COUNT_VALUE;
397 396
   $_PRINT_COUNT_VALUE++;
398 397
 
399
-  if($prePrint) {
398
+  if ($prePrint) {
400 399
     print("<br>");
401 400
   }
402 401
   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
@@ -141,11 +141,13 @@  discard block
 block discarded – undo
141 141
     if($deadlock && ($q = SN::$db->mysql_get_innodb_status())) {
142 142
       $error_backtrace['deadlock'] = explode("\n", $q['Status']);
143 143
       foreach($error_backtrace['cSN_data'] as &$location) {
144
-        foreach($location as $location_id => &$location_data) //          $location_data = $location_id;
144
+        foreach($location as $location_id => &$location_data) {
145
+          //          $location_data = $location_id;
145 146
         {
146 147
           $location_data = isset($location_data['username']) ? $location_data['username'] :
147 148
             (isset($location_data['name']) ? $location_data['name'] : $location_id);
148 149
         }
150
+        }
149 151
       }
150 152
     }
151 153
 
@@ -276,8 +278,7 @@  discard block
 block discarded – undo
276 278
    *
277 279
    * @return void
278 280
    */
279
-  function _writeLogMessage($httpCode, $user, $title, $message, array $error_backtrace, $fatal_error)
280
-  {
281
+  function _writeLogMessage($httpCode, $user, $title, $message, array $error_backtrace, $fatal_error) {
281 282
     /** @noinspection SqlResolve */
282 283
     $query = "INSERT INTO `{{logs}}` SET
283 284
         `log_time` = '" . time() . "', `log_code` = '" . SN::$db->db_escape($httpCode) . "', " .
Please login to merge, or discard this patch.
buildings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@
 block discarded – undo
21 21
 $mode = sys_get_param_escaped('mode');
22 22
 $mode = (!$mode || $mode == 'buildings') ? QUE_STRUCTURES : ($mode == 'fleet' ? SUBQUE_FLEET : ($mode == 'defense' ? SUBQUE_DEFENSE : ($mode == 'research' ? QUE_RESEARCH : $mode)));
23 23
 
24
-if($building_sort = sys_get_param_id('sort_elements')) {
25
-  if(!empty($lang['player_option_building_sort'][$building_sort])) {
24
+if ($building_sort = sys_get_param_id('sort_elements')) {
25
+  if (!empty($lang['player_option_building_sort'][$building_sort])) {
26 26
     SN::$user_options[array(PLAYER_OPTION_BUILDING_SORT, $mode)] = $building_sort;
27 27
     SN::$user_options[array(PLAYER_OPTION_BUILDING_SORT_INVERSE, $mode)] = sys_get_param_id('sort_elements_inverse', 0);
28 28
   }
Please login to merge, or discard this patch.
includes/pages/options.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
     unset($player_options[PLAYER_OPTION_TUTORIAL_CURRENT]);
402 402
   }
403 403
 
404
-  array_walk($player_options, function (&$value) {
404
+  array_walk($player_options, function(&$value) {
405 405
     // TODO - Когда будет больше параметров - сделать больше проверок
406 406
     $value = intval($value);
407 407
   });
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
           $user['id'],
451 451
           RPG_NAME_CHANGE,
452 452
           -$config->game_user_changename_cost,
453
-          vsprintf('Пользователь ID %1$d сменил имя с "%2$s" на "%3$s"', [$user['id'], $user['username'], $username,])
453
+          vsprintf('Пользователь ID %1$d сменил имя с "%2$s" на "%3$s"', [$user['id'], $user['username'], $username, ])
454 454
         );
455 455
 
456 456
       case SERVER_PLAYER_NAME_CHANGE_FREE:
Please login to merge, or discard this patch.
classes/Core/Autoloader.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
   protected static $autoloaderRegistered = false;
25 25
 
26 26
   protected static function _constructorStatic() {
27
-    if(!static::$autoloaderRegistered) {
27
+    if (!static::$autoloaderRegistered) {
28 28
       spl_autoload_register(array(__CLASS__, 'autoloader'));
29 29
       static::$autoloaderRegistered = true;
30 30
     }
@@ -36,17 +36,17 @@  discard block
 block discarded – undo
36 36
   public static function autoloader($class) {
37 37
     static::_constructorStatic();
38 38
 
39
-    foreach(static::$folders as $data) {
39
+    foreach (static::$folders as $data) {
40 40
       $theClassFile = $class;
41 41
 
42
-      if($data[static::P_PREFIX] && strrpos($class, $data[static::P_PREFIX]) !== false) {
42
+      if ($data[static::P_PREFIX] && strrpos($class, $data[static::P_PREFIX]) !== false) {
43 43
         $theClassFile = substr($class, strlen($data[static::P_PREFIX]));
44 44
       }
45 45
 
46 46
       $classFullFileName = str_replace('\\', '/', $data[static::P_FOLDER] . $theClassFile) . DOT_PHP_EX;
47
-      if(file_exists($classFullFileName) && is_file($classFullFileName)) {
47
+      if (file_exists($classFullFileName) && is_file($classFullFileName)) {
48 48
         require_once($classFullFileName);
49
-        if(method_exists($class, '_constructorStatic')) {
49
+        if (method_exists($class, '_constructorStatic')) {
50 50
           $class::_constructorStatic();
51 51
         }
52 52
       }
@@ -62,13 +62,13 @@  discard block
 block discarded – undo
62 62
 
63 63
     $absoluteClassRoot = str_replace('\\', '/', SN_ROOT_PHYSICAL . $absoluteClassRoot);
64 64
 
65
-    if(!($absoluteClassRoot = realpath($absoluteClassRoot))) {
65
+    if (!($absoluteClassRoot = realpath($absoluteClassRoot))) {
66 66
       // TODO - throw new \Exception("There is some error when installing autoloader for '{$absoluteClassRoot}' class prefix '{$classPrefix}'");
67 67
       return;
68 68
     }
69 69
     $absoluteClassRoot = str_replace('\\', '/', $absoluteClassRoot) . '/';
70 70
 
71
-    if($classPrefix && strrpos($classPrefix, 1) != '\\') {
71
+    if ($classPrefix && strrpos($classPrefix, 1) != '\\') {
72 72
       $classPrefix .= '\\';
73 73
     }
74 74
 
Please login to merge, or discard this patch.