Test Failed
Push — master ( 247090...f61425 )
by SuperNova.WS
18:56 queued 11:23
created
admin/adm_log_main.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,26 +18,26 @@  discard block
 block discarded – undo
18 18
 
19 19
 SnTemplate::messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR);
20 20
 
21
-if($delete = sys_get_param_id('delete'))
21
+if ($delete = sys_get_param_id('delete'))
22 22
 {
23 23
   doquery("DELETE FROM `{{logs}}` WHERE `log_id` = {$delete} LIMIT 1;");
24 24
 }
25
-elseif(sys_get_param_str('delete_update_info'))
25
+elseif (sys_get_param_str('delete_update_info'))
26 26
 {
27 27
   doquery("DELETE FROM `{{logs}}` WHERE `log_code` in (103, 180, 191);");
28 28
 }
29
-elseif(sys_get_param_str('deleteall') == 'yes')
29
+elseif (sys_get_param_str('deleteall') == 'yes')
30 30
 {
31 31
 //  doquery("TRUNCATE TABLE `{{logs}}`");
32 32
 }
33 33
 
34
-if($detail = sys_get_param_id('detail'))
34
+if ($detail = sys_get_param_id('detail'))
35 35
 {
36 36
   $template = SnTemplate::gettemplate('admin/adm_log_main_detail', true);
37 37
 
38 38
   $errorInfo = doquery("SELECT * FROM `{{logs}}` WHERE `log_id` = {$detail} LIMIT 1;", true);
39 39
   $error_dump = unserialize($errorInfo['log_dump']);
40
-  if(is_array($error_dump))
40
+  if (is_array($error_dump))
41 41
   {
42 42
     foreach ($error_dump as $key => $value)
43 43
     {
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
 
58 58
   $i = 0;
59 59
   $query = doquery("SELECT * FROM `{{logs}}` ORDER BY log_id DESC LIMIT 100;");
60
-  while($u = db_fetch($query))
60
+  while ($u = db_fetch($query))
61 61
   {
62 62
     $i++;
63 63
     $v = array();
64
-    foreach($u as $key => $value)
64
+    foreach ($u as $key => $value)
65 65
     {
66 66
       $v[strtoupper($key)] = $value;
67 67
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,12 +21,10 @@  discard block
 block discarded – undo
21 21
 if($delete = sys_get_param_id('delete'))
22 22
 {
23 23
   doquery("DELETE FROM `{{logs}}` WHERE `log_id` = {$delete} LIMIT 1;");
24
-}
25
-elseif(sys_get_param_str('delete_update_info'))
24
+} elseif(sys_get_param_str('delete_update_info'))
26 25
 {
27 26
   doquery("DELETE FROM `{{logs}}` WHERE `log_code` in (103, 180, 191);");
28
-}
29
-elseif(sys_get_param_str('deleteall') == 'yes')
27
+} elseif(sys_get_param_str('deleteall') == 'yes')
30 28
 {
31 29
 //  doquery("TRUNCATE TABLE `{{logs}}`");
32 30
 }
@@ -50,8 +48,7 @@  discard block
 block discarded – undo
50 48
     }
51 49
   }
52 50
   $template->assign_vars($errorInfo);
53
-}
54
-else
51
+} else
55 52
 {
56 53
   $template = SnTemplate::gettemplate('admin/adm_log_main', true);
57 54
 
Please login to merge, or discard this patch.
admin/planet_edit.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
       if ($unit_query_string = admin_planet_edit_query_string($unit_id, $unit_amount, $mode)) {
71 71
         $query_string[] = $unit_query_string;
72 72
       }
73
-    } elseif (in_array($mode, [UNIT_SHIPS_STR, UNIT_STRUCTURES_STR, UNIT_DEFENCE_STR,]) ) {
73
+    } elseif (in_array($mode, [UNIT_SHIPS_STR, UNIT_STRUCTURES_STR, UNIT_DEFENCE_STR, ])) {
74 74
       if (!floatval($unit_amount)) {
75 75
         continue;
76 76
       }
Please login to merge, or discard this patch.
admin/statbuilder.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
  * @copyright 2008 by Chlorel for XNova
10 10
  */
11 11
 
12
-define('INSIDE'  , true);
13
-define('INSTALL' , false);
12
+define('INSIDE', true);
13
+define('INSTALL', false);
14 14
 define('IN_ADMIN', true);
15 15
 require_once('../common.' . substr(strrchr(__FILE__, '.'), 1));
16 16
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 
19 19
 SnTemplate::messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR);
20 20
 
21
-if(SN_TIME_NOW >= SN::$config->pass()->var_stat_update_admin_forced && SN_TIME_NOW >= SN::$config->pass()->var_stat_update_end)
21
+if (SN_TIME_NOW >= SN::$config->pass()->var_stat_update_admin_forced && SN_TIME_NOW >= SN::$config->pass()->var_stat_update_end)
22 22
 {
23 23
   SN::$config->pass()->var_stat_update_admin_forced = SN_TIME_NOW + 120;
24 24
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,8 +37,7 @@
 block discarded – undo
37 37
   </script>';
38 38
 
39 39
   SnTemplate::messageBoxAdmin("{$script}<img src=\"design/images/progressbar.gif\"><br>{$lang['sys_wait']}", $lang['adm_stat_title'], '', 0);
40
-}
41
-else
40
+} else
42 41
 {
43 42
   SnTemplate::messageBoxAdmin($lang['adm_stat_already_started'], $lang['adm_stat_title'], 'admin/overview.php');
44 43
 }
Please login to merge, or discard this patch.
admin/settings.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 
11 11
 use Unit\DBStaticUnit;
12 12
 
13
-define('INSIDE'  , true);
14
-define('INSTALL' , false);
13
+define('INSIDE', true);
14
+define('INSTALL', false);
15 15
 define('IN_ADMIN', true);
16 16
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
17 17
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 $template = SnTemplate::gettemplate('admin/settings', true);
23 23
 
24
-if(sys_get_param('save')) {
24
+if (sys_get_param('save')) {
25 25
   SN::$config->game_name               = sys_get_param_str_unsafe('game_name');
26 26
   SN::$config->game_mode               = sys_get_param_int('game_mode');
27 27
   SN::$config->game_speed              = sys_get_param_float('game_speed', 1);
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
   SN::$config->url_faq                 = sys_get_param_str_unsafe('url_faq');
32 32
   SN::$config->url_forum               = sys_get_param_str_unsafe('url_forum');
33 33
   SN::$config->url_rules               = sys_get_param_str_unsafe('url_rules');
34
-  SN::$config->url_purchase_metamatter         = sys_get_param_str_unsafe('url_purchase_metamatter');
34
+  SN::$config->url_purchase_metamatter = sys_get_param_str_unsafe('url_purchase_metamatter');
35 35
   SN::$config->game_disable            = sys_get_param_int('game_disable');
36 36
   SN::$config->game_disable_reason     = sys_get_param_str_unsafe('game_disable_reason');
37 37
   SN::$config->server_updater_check_auto = sys_get_param_int('server_updater_check_auto');
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
   SN::$config->stats_schedule          = sys_get_param_str('stats_schedule');
102 102
 
103 103
   SN::$config->empire_mercenary_base_period = sys_get_param_int('empire_mercenary_base_period');
104
-  if(SN::$config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) {
105
-    if(SN::$config->empire_mercenary_temporary) {
104
+  if (SN::$config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) {
105
+    if (SN::$config->empire_mercenary_temporary) {
106 106
       DBStaticUnit::db_unit_list_admin_delete_mercenaries_finished();
107 107
     } else {
108 108
       DBStaticUnit::db_unit_list_admin_set_mercenaries_expire_time(SN::$config->empire_mercenary_base_period);
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 SnTemplate::tpl_assign_select($template, 'ver_response', SN::$lang['adm_opt_ver_response'], 'ID', 'NAME');
153 153
 
154 154
 $lang_list = lng_get_list();
155
-foreach($lang_list as $lang_id => $lang_data) {
155
+foreach ($lang_list as $lang_id => $lang_data) {
156 156
   $template->assign_block_vars('game_languages', array(
157 157
     'ID'   => $lang_id,
158 158
     'NAME' => "{$lang_data['LANG_NAME_NATIVE']} ({$lang_data['LANG_NAME_ENGLISH']})",
Please login to merge, or discard this patch.
admin/ajax_maintenance.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 
5 5
 require('../includes/init.' . substr(strrchr(__FILE__, '.'), 1));
6 6
 
7
-if($user['authlevel'] < 3)
7
+if ($user['authlevel'] < 3)
8 8
 {
9 9
   SnTemplate::messageBox($lang['sys_noalloaw'], $lang['sys_noaccess']);
10 10
   die();
@@ -19,9 +19,9 @@  discard block
 block discarded – undo
19 19
 
20 20
 // [#] info_best_battles 1b0
21 21
 $best_reports = array();
22
-if(defined('MODULE_INFO_BEST_BATTLES_QUERY')) {
22
+if (defined('MODULE_INFO_BEST_BATTLES_QUERY')) {
23 23
   $query = doquery(MODULE_INFO_BEST_BATTLES_QUERY);
24
-  while($row = db_fetch($query)) {
24
+  while ($row = db_fetch($query)) {
25 25
     $best_reports[] = $row['ube_report_id'];
26 26
   }
27 27
 }
@@ -188,16 +188,16 @@  discard block
 block discarded – undo
188 188
 
189 189
 function sn_maintenance_pack_user_list($user_list) {
190 190
   $user_list = explode(',', $user_list);
191
-  foreach($user_list as $key => $user_id) {
192
-    if(!is_numeric($user_id)) {
191
+  foreach ($user_list as $key => $user_id) {
192
+    if (!is_numeric($user_id)) {
193 193
       unset($user_list[$key]);
194 194
     }
195 195
   }
196 196
 
197 197
   $result = array();
198
-  if(!empty($user_list)) {
198
+  if (!empty($user_list)) {
199 199
     $query = doquery("SELECT `id` FROM `{{users}}` WHERE `id` in (" . implode(',', $user_list) . ")");
200
-    while($row = db_fetch($query)) {
200
+    while ($row = db_fetch($query)) {
201 201
       $result[] = $row['id'];
202 202
     }
203 203
   }
@@ -212,11 +212,11 @@  discard block
 block discarded – undo
212 212
 $old_server_status == GAME_DISABLE_NONE ? SN::$config->pass()->game_disable = GAME_DISABLE_MAINTENANCE : false;
213 213
 sn_db_transaction_commit();
214 214
 
215
-foreach($ques as $que_transaction) {
215
+foreach ($ques as $que_transaction) {
216 216
   sn_db_transaction_start();
217 217
 
218 218
   !is_array($que_transaction) ? $que_transaction = array($que_transaction) : false;
219
-  foreach($que_transaction as $que) {
219
+  foreach ($que_transaction as $que) {
220 220
     set_time_limit(120);
221 221
     $QryResult = doquery($que);
222 222
     //$msg .= '<hr>' . $que . '<hr>';
Please login to merge, or discard this patch.
admin/adm_planet_list.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-define('INSIDE'  , true);
4
-define('INSTALL' , false);
3
+define('INSIDE', true);
4
+define('INSTALL', false);
5 5
 define('IN_ADMIN', true);
6 6
 
7 7
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 SnTemplate::messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR);
12 12
 
13 13
 $planet_active = sys_get_param_int('planet_active');
14
-if(!$planet_active) {
14
+if (!$planet_active) {
15 15
   $planet_type = sys_get_param_int('planet_type', 1);
16 16
   $planet_type = $planet_type == 3 ? 3 : 1;
17 17
 } else {
@@ -40,8 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
 $page_title = 
42 42
   $lang['adm_planet_list_title'] . ': ' . 
43
-  ($planet_active ? $lang['adm_planet_active'] :
44
-    ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '')
43
+  ($planet_active ? $lang['adm_planet_active'] : ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '')
45 44
   );
46 45
 $template->assign_vars(array(
47 46
   'PAGE_TITLE' => $page_title,
Please login to merge, or discard this patch.
admin/adm_user_stat.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
   return $a['DATE'] == $b['DATE'] ? 0 : ($a['DATE'] > $b['DATE'] ? 1 : -1);
19 19
 }
20 20
 
21
-if($user['authlevel'] < 3)
21
+if ($user['authlevel'] < 3)
22 22
 {
23 23
   AdminMessage($lang['adm_err_denied']);
24 24
 }
@@ -26,12 +26,12 @@  discard block
 block discarded – undo
26 26
 $template = SnTemplate::gettemplate('admin/adm_user_stat', true);
27 27
 
28 28
 $dt_from = sys_get_param_date_sql('dt_from', '2000-01-01');
29
-if(strlen($dt_from) == 4)
29
+if (strlen($dt_from) == 4)
30 30
 {
31 31
   $dt_from .= '-01';
32 32
 }
33 33
 $dt_to = sys_get_param_date_sql('dt_to', date('Y-m-d', SN_TIME_NOW + PERIOD_DAY));
34
-if(strlen($dt_to) == 4)
34
+if (strlen($dt_to) == 4)
35 35
 {
36 36
   $dt_to .= '-01';
37 37
 }
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
 $interval = $min_max_dates['max_register'] - $min_max_dates['min_register'];
45 45
 
46
-switch(true)
46
+switch (true)
47 47
 {
48 48
   case $interval >= PERIOD_YEAR * 4:
49 49
     $sql_group_format = "%Y";
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     DATE_FORMAT(account_register_time, '%a') AS DoW, 
83 83
     DATE_FORMAT(DATE_ADD(account_register_time, INTERVAL 1 {$sql_date_add}), '{$sql_group_format}') AS date_next
84 84
 FROM {{account}} WHERE 1 " . $sql_date2 . " GROUP BY {$sql_group_by2}");
85
-while($row = db_fetch($query))
85
+while ($row = db_fetch($query))
86 86
 {
87 87
   $stat_date[$row['the_date']] = array(
88 88
     'DATE' => $row['the_date'],
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 $sql_group_by = "DATE_FORMAT(FROM_UNIXTIME(register_time), '{$sql_group_format}')";
99 99
 $query = doquery("SELECT count(*) AS the_count, {$sql_group_by} AS the_date, DATE_FORMAT(DATE_ADD(FROM_UNIXTIME(register_time), INTERVAL 1 {$sql_date_add}), '{$sql_group_format}') AS date_next
100 100
 FROM {{users}} WHERE user_as_ally IS NULL " . $sql_date . " GROUP BY {$sql_group_by}");
101
-while($row = db_fetch($query))
101
+while ($row = db_fetch($query))
102 102
 {
103 103
   $stat_date[$row['the_date']]['REGISTERED'] = $row['the_count'];
104 104
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 " AND onlinetime <= register_time + " . PERIOD_DAY .
110 110
 ' AND UNIX_TIMESTAMP(NOW()) >= register_time  + ' . PERIOD_DAY .
111 111
 $sql_date . " GROUP BY {$sql_group_by}");
112
-while($row = db_fetch($query))
112
+while ($row = db_fetch($query))
113 113
 {
114 114
   $stat_date[$row['the_date']]['REJECTED'] = $row['the_count'];
115 115
 }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 ' AND onlinetime <= register_time + ' . PERIOD_WEEK .
120 120
 ' AND UNIX_TIMESTAMP(NOW()) >= register_time + ' . PERIOD_WEEK .
121 121
 $sql_date . " GROUP BY {$sql_group_by}");
122
-while($row = db_fetch($query))
122
+while ($row = db_fetch($query))
123 123
 {
124 124
   $stat_date[$row['the_date']]['LEAVED'] = $row['the_count'];
125 125
 }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 ' AND UNIX_TIMESTAMP(NOW()) - onlinetime <= ' . PERIOD_DAY .
129 129
 ' AND UNIX_TIMESTAMP(NOW()) - register_time >= ' . PERIOD_DAY .
130 130
 $sql_date . " GROUP BY {$sql_group_by}");
131
-while($row = db_fetch($query))
131
+while ($row = db_fetch($query))
132 132
 {
133 133
   $stat_date[$row['the_date']]['ACTIVE'] = $row['the_count'];
134 134
 }
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 ' AND UNIX_TIMESTAMP(NOW()) - onlinetime <= ' . PERIOD_WEEK .
139 139
 ' AND UNIX_TIMESTAMP(NOW()) - register_time >= ' . PERIOD_WEEK .
140 140
 $sql_date . " GROUP BY {$sql_group_by}");
141
-while($row = db_fetch($query))
141
+while ($row = db_fetch($query))
142 142
 {
143 143
   $stat_date[$row['the_date']]['DORMANT'] = $row['the_count'];
144 144
 }
@@ -146,13 +146,13 @@  discard block
 block discarded – undo
146 146
 uasort($stat_date, 'admin_date_sort');
147 147
 
148 148
 $total = array();
149
-foreach($stat_date as $key => &$value)
149
+foreach ($stat_date as $key => &$value)
150 150
 {
151 151
   $value['TOTAL'] = $value['REJECTED'] + $value['LEAVED'];
152 152
   $value['LEAVED_PERCENT'] = $value['REGISTERED'] ? round($value['TOTAL'] / $value['REGISTERED'] * 100) : 0;
153 153
   $value['ACTIVE_PERCENT'] = $value['REGISTERED'] ? round($value['ACTIVE'] / $value['REGISTERED'] * 100) : 0;
154 154
   $value['DORMANT_PERCENT'] = $value['REGISTERED'] ? round($value['DORMANT'] / $value['REGISTERED'] * 100) : 0;
155
-  foreach($value as $key2 => $value2)
155
+  foreach ($value as $key2 => $value2)
156 156
   {
157 157
     $total[$key2] += $value2;
158 158
   }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,7 @@
 block discarded – undo
13 13
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
14 14
 
15 15
 
16
-function admin_date_sort($a, $b)
17
-{
16
+function admin_date_sort($a, $b) {
18 17
   return $a['DATE'] == $b['DATE'] ? 0 : ($a['DATE'] > $b['DATE'] ? 1 : -1);
19 18
 }
20 19
 
Please login to merge, or discard this patch.
phalanx.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 $scan_galaxy  = sys_get_param_int('galaxy');
32 32
 $scan_system  = sys_get_param_int('system');
33 33
 $scan_planet  = sys_get_param_int('planet');
34
-$scan_planet_type  = 1; // sys_get_param_int('planettype');
34
+$scan_planet_type = 1; // sys_get_param_int('planettype');
35 35
 $id = sys_get_param_id('id');
36 36
 
37 37
 $source_galaxy = $planetrow['galaxy'];
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 $sensorRange = GetPhalanxRange($sensorLevel);
42 42
 
43 43
 $system_distance = abs($source_system - $scan_system);
44
-if($system_distance > $sensorRange || $scan_galaxy != $source_galaxy)
44
+if ($system_distance > $sensorRange || $scan_galaxy != $source_galaxy)
45 45
 {
46 46
   SnTemplate::messageBox($lang['phalanx_rangeerror'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
47 47
 }
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
 }
55 55
 
56 56
 $planet_scanned = DBStaticPlanet::db_planet_by_gspt($scan_galaxy, $scan_system, $scan_planet, $scan_planet_type);
57
-if(!$planet_scanned['id'])
57
+if (!$planet_scanned['id'])
58 58
 {
59 59
   SnTemplate::messageBox($lang['phalanx_planet_not_exists'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
60 60
 }
61 61
 
62
-if($planet_scanned['destruyed'])
62
+if ($planet_scanned['destruyed'])
63 63
 {
64 64
   SnTemplate::messageBox($lang['phalanx_planet_destroyed'], $lang['tech'][STRUC_MOON_PHALANX], '', 3);
65 65
 }
Please login to merge, or discard this patch.
language/en/alliance.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 = [
Please login to merge, or discard this patch.