Test Failed
Push — trunk ( cc4c01...dc8fe4 )
by SuperNova.WS
13:09
created
includes/functions/eco_get_build_data.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
     $query                       = DBStaticUnit::db_unit_list_laboratories($user['id']);
20 20
     while ($row = db_fetch($query)) {
21 21
       if (!eco_unit_busy($user, $row, UNIT_TECHNOLOGIES)) {
22
-        $row                                     += array(
22
+        $row += array(
23 23
           STRUC_LABORATORY             => $level_lab = mrc_get_level($user, $row, STRUC_LABORATORY),
24 24
           STRUC_LABORATORY_NANO        => $level_lab_nano = mrc_get_level($user, $row, STRUC_LABORATORY_NANO),
25 25
           'laboratory_effective_level' => $level_lab * pow(2, $level_lab_nano),
Please login to merge, or discard this patch.
includes/general/general.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -332,7 +332,7 @@
 block discarded – undo
332 332
     $time_left     = min(floor($time_left / PERIOD_DAY), $term_original);
333 333
     $cost_left     = $term_original > 0 ? ceil($time_left / $term_original * $original_cost) : 0;
334 334
 
335
-    array_walk_recursive($result, function (&$value) use ($cost_left) {
335
+    array_walk_recursive($result, function(&$value) use ($cost_left) {
336 336
       $value -= $cost_left;
337 337
     });
338 338
   }
Please login to merge, or discard this patch.
classes/Pages/Deprecated/PageImperium.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -262,7 +262,7 @@
 block discarded – undo
262 262
     foreach ($planets as $planetId => $planet) {
263 263
       $templatizedPlanet = tpl_parse_planet($user, $planet);
264 264
 
265
-      if($planet['planet_type'] == PT_MOON) {
265
+      if ($planet['planet_type'] == PT_MOON) {
266 266
         $parentPlanet = DBStaticPlanet::db_planet_by_id($planet['parent_planet']);
267 267
       } else {
268 268
         $parentPlanet = $planet;
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
 }
@@ -204,16 +204,16 @@  discard block
 block discarded – undo
204 204
 
205 205
 function sn_maintenance_pack_user_list($user_list) {
206 206
   $user_list = explode(',', $user_list);
207
-  foreach($user_list as $key => $user_id) {
208
-    if(!is_numeric($user_id)) {
207
+  foreach ($user_list as $key => $user_id) {
208
+    if (!is_numeric($user_id)) {
209 209
       unset($user_list[$key]);
210 210
     }
211 211
   }
212 212
 
213 213
   $result = array();
214
-  if(!empty($user_list)) {
214
+  if (!empty($user_list)) {
215 215
     $query = doquery("SELECT `id` FROM `{{users}}` WHERE `id` in (" . implode(',', $user_list) . ")");
216
-    while($row = db_fetch($query)) {
216
+    while ($row = db_fetch($query)) {
217 217
       $result[] = $row['id'];
218 218
     }
219 219
   }
@@ -228,11 +228,11 @@  discard block
 block discarded – undo
228 228
 $old_server_status == GAME_DISABLE_NONE ? SN::$config->pass()->game_disable = GAME_DISABLE_MAINTENANCE : false;
229 229
 SN::db_transaction_commit();
230 230
 
231
-foreach($ques as $que_transaction) {
231
+foreach ($ques as $que_transaction) {
232 232
   SN::db_transaction_start();
233 233
 
234 234
   !is_array($que_transaction) ? $que_transaction = array($que_transaction) : false;
235
-  foreach($que_transaction as $que) {
235
+  foreach ($que_transaction as $que) {
236 236
     set_time_limit(120);
237 237
     $QryResult = doquery($que);
238 238
     //$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.
dark_matter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 include_once('common.' . substr(strrchr(__FILE__, '.'), 1));
4 4
 
5
-if(SN::$gc->modules->countModulesInGroup('payment') && !SN_GOOGLE) {
5
+if (SN::$gc->modules->countModulesInGroup('payment') && !SN_GOOGLE) {
6 6
   sys_redirect('metamatter.php');
7 7
 }
8 8
 
Please login to merge, or discard this patch.
flotenajax.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -35,14 +35,14 @@  discard block
 block discarded – undo
35 35
   'planet' => $target_planet = sys_get_param_int('planet'),
36 36
 );
37 37
 
38
-if(!uni_coordinates_valid($target_coord))
38
+if (!uni_coordinates_valid($target_coord))
39 39
 {
40 40
   die($lang['gs_c02']);
41 41
 }
42 42
 
43 43
 $target_mission = sys_get_param_int('mission');
44 44
 $sn_group_missions = sn_get_groups('missions');
45
-if(!isset($sn_group_missions[$target_mission]['AJAX']) || !$sn_group_missions[$target_mission]['AJAX'])
45
+if (!isset($sn_group_missions[$target_mission]['AJAX']) || !$sn_group_missions[$target_mission]['AJAX'])
46 46
 {
47 47
   die($lang['gs_c00']);
48 48
 }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 $target_coord['planet_type'] = $target_planet_check;
59 59
 $target_row = DBStaticPlanet::db_planet_by_vector($target_coord);
60 60
 
61
-if(empty($target_row))
61
+if (empty($target_row))
62 62
 {
63 63
   $target_row = array(
64 64
     'galaxy' => $target_coord['galaxy'],
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 }
71 71
 
72 72
 $fleet_array = array();
73
-switch($target_mission)
73
+switch ($target_mission)
74 74
 {
75 75
   case MT_SPY:
76 76
     // $fleet_array[SHIP_SPY] = min(mrc_get_level($user, $planetrow, SHIP_SPY), abs($user['spio_anz']));
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
   break;
80 80
 
81 81
   case MT_RECYCLE:
82
-    foreach(sn_get_groups('flt_recyclers') as $unit_id)
82
+    foreach (sn_get_groups('flt_recyclers') as $unit_id)
83 83
     {
84
-      if($unit_count = mrc_get_level($user, $planetrow, $unit_id))
84
+      if ($unit_count = mrc_get_level($user, $planetrow, $unit_id))
85 85
       {
86 86
         $fleet_array[$unit_id] = $unit_count;
87 87
       }
@@ -102,14 +102,14 @@  discard block
 block discarded – undo
102 102
 $cant_attack = flt_can_attack($planetrow, $target_row, $fleet_array, $target_mission, $options);
103 103
 
104 104
 
105
-if($cant_attack != ATTACK_ALLOWED)
105
+if ($cant_attack != ATTACK_ALLOWED)
106 106
 {
107 107
   die($lang['fl_attack_error'][$cant_attack]);
108 108
 }
109 109
 
110
-$FleetDBArray   = array();
110
+$FleetDBArray = array();
111 111
 $db_changeset = array();
112
-foreach($fleet_array as $unit_id => $unit_count)
112
+foreach ($fleet_array as $unit_id => $unit_count)
113 113
 {
114 114
   $FleetDBArray[] = "{$unit_id},{$unit_count}";
115 115
   $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($unit_id, -$unit_count, $user, $planetrow);
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
 $fleet_ship_count = array_sum($fleet_array);
120 120
 
121
-if($target_mission == MT_MISSILE)
121
+if ($target_mission == MT_MISSILE)
122 122
 {
123 123
   $distance = abs($target_coord['system'] - $planetrow['system']);
124 124
   $duration = round((30 + (60 * $distance)) / Universe::flt_server_flight_speed_multiplier());
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 {
137 137
   $travel_data = flt_travel_data($user, $planetrow, $target_coord, $fleet_array, 10);
138 138
 
139
-  if($planetrow['deuterium'] < $travel_data['consumption'])
139
+  if ($planetrow['deuterium'] < $travel_data['consumption'])
140 140
   {
141 141
     die($lang['gs_c13']);
142 142
   }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 $ships_sent = array();
175 175
 //$ships_sent_js = array();
176 176
 $ships_sent_js = 0;
177
-foreach($fleet_array as $unit_id => $unit_count)
177
+foreach ($fleet_array as $unit_id => $unit_count)
178 178
 {
179 179
   $ships_sent[] = "{$unit_count} {$lang['tech'][$unit_id]}";
180 180
   $ships_sent_js += mrc_get_level($user, $planetrow, $unit_id, false, true);
@@ -183,6 +183,6 @@  discard block
 block discarded – undo
183 183
 //$ships_sent_js = implode(',', $ships_sent_js);
184 184
 $ships_sent_js = "{$unit_group}={$ships_sent_js}";
185 185
 
186
-$ResultMessage  = "{$lang['gs_sending']} {$ships_sent} {$lang['gs_to']} {$target_coord['galaxy']}:{$target_coord['system']}:{$target_coord['planet']}|{$ships_sent_js}";
186
+$ResultMessage = "{$lang['gs_sending']} {$ships_sent} {$lang['gs_to']} {$target_coord['galaxy']}:{$target_coord['system']}:{$target_coord['planet']}|{$ships_sent_js}";
187 187
 
188 188
 die($ResultMessage);
Please login to merge, or discard this patch.
stat.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
   global $who, $lang;
16 16
 
17 17
   // $sn_group_stat_common = sn_get_groups('STAT_COMMON');
18
-  foreach($array as $key => $value) {
19
-    if($array_name == 'type' && $who == 2 && !in_array($key, $sn_group_stat_common)) {
18
+  foreach ($array as $key => $value) {
19
+    if ($array_name == 'type' && $who == 2 && !in_array($key, $sn_group_stat_common)) {
20 20
       continue;
21 21
     }
22 22
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 $subject_list = array(
49 49
   1 => array('header' => $lang['stat_player']),
50 50
 );
51
-if(!$source) {
51
+if (!$source) {
52 52
   $subject_list[2] = array('header' => $lang['stat_allys']);
53 53
 }
54 54
 stat_tpl_assign($template, $who, 'subject', $subject_list, $sn_group_stat_common);
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
 $page_count = floor($record_count / 100);
117 117
 $pages = array();
118
-for($i = 0; $i <= $page_count; $i++) {
118
+for ($i = 0; $i <= $page_count; $i++) {
119 119
   $first_element = $i * 100 + 1;
120 120
   $last_element = $first_element + 99;
121 121
   $pages[$first_element] = array(
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     'POINTS' => HelperString::numberFloorAndFormat($row['points']),
135 135
   );
136 136
 
137
-  if($who == WHO_IS_USER) {
137
+  if ($who == WHO_IS_USER) {
138 138
     $row_stat['ALLY_NAME'] = $row['ally_name'];
139 139
     $row_stat['ALLY_ID'] = $row['ally_id'];
140 140
     empty($row['username']) ? $row['username'] = $row['name'] : false;
Please login to merge, or discard this patch.
classes/Fleet/FleetStatic.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
    * @return DbMysqliResultIterator|EmptyCountableIterator
19 19
    */
20 20
   public static function dbFleetsOnHoldOnPlanetsByIds($planetIds, $time = SN_TIME_NOW) {
21
-    if(empty($planetIds) || !is_array($planetIds)) {
21
+    if (empty($planetIds) || !is_array($planetIds)) {
22 22
       return new EmptyCountableIterator();
23 23
     }
24 24
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     $speeds = array();
42 42
     if (!empty($fleet)) {
43 43
       foreach ($fleet as $ship_id => $amount) {
44
-        if ($amount && in_array($ship_id, sn_get_groups(['fleet', 'missile',]))) {
44
+        if ($amount && in_array($ship_id, sn_get_groups(['fleet', 'missile', ]))) {
45 45
           $single_ship_data = !empty($shipData[$ship_id]) ? $shipData[$ship_id] : get_ship_data($ship_id, $user);
46 46
           $speeds[]         = $single_ship_data['speed'];
47 47
         }
Please login to merge, or discard this patch.