Test Failed
Pull Request — master (#53)
by
unknown
09:32
created
includes/pages/techtree.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@
 block discarded – undo
14 14
   global $lang, $user, $planetrow;
15 15
 
16 16
   $tech_tree = array();
17
-  foreach(get_unit_param('techtree') as $unit_group_id => $unit_list)
17
+  foreach (get_unit_param('techtree') as $unit_group_id => $unit_list)
18 18
   {
19 19
     $tech_tree[] = array(
20 20
       'NAME' => $lang['tech'][$unit_group_id],
21 21
       'GROUP_ID' => $unit_group_id,
22 22
     );
23 23
 
24
-    foreach($unit_list as $unit_id)
24
+    foreach ($unit_list as $unit_id)
25 25
     {
26 26
       $sn_data_unit = get_unit_param($unit_id);
27 27
       $level_basic = $sn_data_unit[P_STACKABLE] ? 0 : mrc_get_level($user, $planetrow, $unit_id, false, true);
Please login to merge, or discard this patch.
includes/functions/geoip.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-function geoip_status(){return sn_function_call('geoip_status', array(&$result));}
3
+function geoip_status() {return sn_function_call('geoip_status', array(&$result)); }
4 4
 function sn_geoip_status(&$result) {
5 5
   return $result = false;
6 6
 }
7 7
 
8
-function geoip_ip_info($ip){return sn_function_call('geoip_ip_info', array($ip, &$result));}
8
+function geoip_ip_info($ip) {return sn_function_call('geoip_ip_info', array($ip, &$result)); }
9 9
 function sn_geoip_ip_info($ip, &$result) {
10 10
   return $result = false;
11 11
 }
Please login to merge, or discard this patch.
quest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@
 block discarded – undo
7 7
  *
8 8
  */
9 9
 
10
-define('INSIDE'  , true);
11
-define('INSTALL' , false);
10
+define('INSIDE', true);
11
+define('INSTALL', false);
12 12
 
13 13
 require('common.' . substr(strrchr(__FILE__, '.'), 1));
14 14
 
Please login to merge, or discard this patch.
login.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 
16 16
 include('includes/init.' . substr(strrchr(__FILE__, '.'), 1));
17 17
 // die();
18
-if($template_result[F_USER_IS_AUTHORIZED]) {
18
+if ($template_result[F_USER_IS_AUTHORIZED]) {
19 19
   sys_redirect('index' . DOT_PHP_EX);
20 20
 }
21 21
 lng_include('login');
Please login to merge, or discard this patch.
market.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 $newstock = $stock;
27 27
 $intError = MARKET_DEAL;
28 28
 
29
-switch($mode)
29
+switch ($mode)
30 30
 {
31 31
   case MARKET_RESOURCES: // Resource trader
32 32
     require('includes/includes/market_trader.inc');
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
 }
83 83
 
84 84
 $message_id = sys_get_param_int('message');
85
-if($message_id != MARKET_NOTHING)
85
+if ($message_id != MARKET_NOTHING)
86 86
 {
87 87
   $template->assign_block_vars('result', array('MESSAGE' => $lang['eco_mrk_errors'][$message_id]));
88 88
 }
89 89
 
90
-if($message)
90
+if ($message)
91 91
 {
92 92
   $template->assign_block_vars('result', array('MESSAGE' => $message));
93 93
 }
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
@@ -27,19 +27,19 @@  discard block
 block discarded – undo
27 27
  */
28 28
 function db_set_make_safe_string($set, $delta = false) {
29 29
   $set_safe = array();
30
-  foreach($set as $field => $value) {
31
-    if(empty($field)) {
30
+  foreach ($set as $field => $value) {
31
+    if (empty($field)) {
32 32
       continue;
33 33
     }
34 34
 
35 35
     $field = '`' . db_escape($field) . '`';
36 36
     $new_value = $value;
37
-    if($value === null) {
37
+    if ($value === null) {
38 38
       $new_value = 'NULL';
39
-    } elseif(is_string($value) && (string)($new_value = floatval($value)) != (string)$value) {
39
+    } elseif (is_string($value) && (string) ($new_value = floatval($value)) != (string) $value) {
40 40
       // non-float
41 41
       $new_value = '"' . db_escape($value) . '"';
42
-    } elseif($delta) {
42
+    } elseif ($delta) {
43 43
       // float and DELTA-set
44 44
       $new_value = "{$field} + ({$new_value})";
45 45
     }
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
  */
60 60
 function missile_list_convert_to_fleet(&$missile_db_list, &$fleet_db_list) {
61 61
   // Missile attack
62
-  foreach($missile_db_list as $irak) {
63
-    if($irak['fleet_end_time'] >= SN_TIME_NOW) {
62
+  foreach ($missile_db_list as $irak) {
63
+    if ($irak['fleet_end_time'] >= SN_TIME_NOW) {
64 64
       $irak['fleet_start_type'] = PT_PLANET;
65 65
       $planet_start = DBStaticPlanet::db_planet_by_vector($irak, 'fleet_start_', false, 'name');
66 66
       $irak['fleet_id'] = -$irak['id'];
Please login to merge, or discard this patch.
includes/functions/int_fleet_events.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -8,23 +8,23 @@  discard block
 block discarded – undo
8 8
   $fleet_events = array();
9 9
   $fleet_number = 0;
10 10
 
11
-  if(empty($fleet_list))
11
+  if (empty($fleet_list))
12 12
   {
13 13
     return;
14 14
   }
15 15
 
16
-  foreach($fleet_list as $fleet)
16
+  foreach ($fleet_list as $fleet)
17 17
   {
18 18
     $planet_start_type = $fleet['fleet_start_type'] == PT_MOON ? PT_MOON : PT_PLANET;
19 19
     $planet_start = DBStaticPlanet::db_planet_by_gspt($fleet['fleet_start_galaxy'], $fleet['fleet_start_system'], $fleet['fleet_start_planet'], $planet_start_type, false, 'name');
20 20
     $fleet['fleet_start_name'] = $planet_start['name'];
21 21
 
22 22
     $planet_end_type = $fleet['fleet_end_type'] == PT_MOON ? PT_MOON : PT_PLANET;
23
-    if($fleet['fleet_end_planet'] > $config->game_maxPlanet)
23
+    if ($fleet['fleet_end_planet'] > $config->game_maxPlanet)
24 24
     {
25 25
       $fleet['fleet_end_name'] = $lang['ov_fleet_exploration'];
26 26
     }
27
-    elseif($fleet['fleet_mission'] == MT_COLONIZE)
27
+    elseif ($fleet['fleet_mission'] == MT_COLONIZE)
28 28
     {
29 29
       $fleet['fleet_end_name'] = $lang['ov_fleet_colonization'];
30 30
     }
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
       $fleet['fleet_end_name'] = $planet_end['name'];
35 35
     }
36 36
 
37
-    if($fleet['fleet_start_time'] > SN_TIME_NOW && $fleet['fleet_mess'] == 0 && $fleet['fleet_mission'] != MT_MISSILE &&
37
+    if ($fleet['fleet_start_time'] > SN_TIME_NOW && $fleet['fleet_mess'] == 0 && $fleet['fleet_mission'] != MT_MISSILE &&
38 38
       ($planet_scanned === false
39 39
         ||
40 40
         (
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
       $fleet_events[] = flt_register_fleet_event($fleet, 0, $planet_end_type);
50 50
     }
51 51
 
52
-    if($fleet['fleet_end_stay'] > SN_TIME_NOW && $fleet['fleet_mess'] == 0 && $planet_scanned === false && $fleet['fleet_mission'] != MT_MISSILE)
52
+    if ($fleet['fleet_end_stay'] > SN_TIME_NOW && $fleet['fleet_mess'] == 0 && $planet_scanned === false && $fleet['fleet_mission'] != MT_MISSILE)
53 53
     {
54 54
       $fleet_events[] = flt_register_fleet_event($fleet, 1, $planet_end_type);
55 55
     }
56 56
 
57
-    if(
57
+    if (
58 58
       $fleet['fleet_end_time'] > SN_TIME_NOW && $fleet['fleet_mission'] != MT_MISSILE && ($fleet['fleet_mess'] == 1 || ($fleet['fleet_mission'] != MT_RELOCATE && $fleet['fleet_mission'] != MT_COLONIZE)) &&
59 59
       (
60 60
         ($planet_scanned === false && $fleet['fleet_owner'] == $user['id'])
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
       $fleet_events[] = flt_register_fleet_event($fleet, 2, $planet_end_type);
72 72
     }
73 73
     
74
-    if($fleet['fleet_mission'] == MT_MISSILE)
74
+    if ($fleet['fleet_mission'] == MT_MISSILE)
75 75
     {
76 76
       $fleet_events[] = flt_register_fleet_event($fleet, 3, $planet_end_type);
77 77
     }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 {
85 85
   global $user, $planetrow, $fleet_number;
86 86
 
87
-  switch($fleet['ov_label'] = $ov_label)
87
+  switch ($fleet['ov_label'] = $ov_label)
88 88
   {
89 89
     case 0:
90 90
       $fleet['event_time'] = $fleet['fleet_start_time'];
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 
117 117
   }
118 118
 
119
-  $fleet['ov_this_planet'] = $is_this_planet;// || $planet_scanned != false;
119
+  $fleet['ov_this_planet'] = $is_this_planet; // || $planet_scanned != false;
120 120
 
121
-  if($fleet['fleet_owner'] == $user['id'])
121
+  if ($fleet['fleet_owner'] == $user['id'])
122 122
   {
123 123
     $user_data = $user;
124 124
   }
Please login to merge, or discard this patch.
includes/includes/uni_rename.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,12 +6,12 @@  discard block
 block discarded – undo
6 6
     $uni_galaxy = sys_get_param_int('galaxy', $planetrow['galaxy']);
7 7
     $uni_system = sys_get_param_int('system');
8 8
 
9
-    if($uni_galaxy < 1 || $uni_galaxy > $config->game_maxGalaxy)
9
+    if ($uni_galaxy < 1 || $uni_galaxy > $config->game_maxGalaxy)
10 10
     {
11 11
       throw new exception($lang['uni_msg_error_wrong_galaxy'], ERR_ERROR);
12 12
     }
13 13
 
14
-    if($uni_system < 0 || $uni_system > $config->game_maxSystem)
14
+    if ($uni_system < 0 || $uni_system > $config->game_maxSystem)
15 15
     {
16 16
       throw new exception($lang['uni_msg_error_wrong_system'], ERR_ERROR);
17 17
     }
@@ -20,12 +20,12 @@  discard block
 block discarded – undo
20 20
     $uni_row['universe_price'] += $uni_system ? $config->uni_price_system : $config->uni_price_galaxy;
21 21
     $uni_row['universe_name'] = strip_tags($uni_row['universe_name'] ? $uni_row['universe_name'] : ($uni_system ? "{$lang['sys_system']} [{$uni_galaxy}:{$uni_system}]" : "{$lang['sys_galaxy']} {$uni_galaxy}"));
22 22
 
23
-    if(sys_get_param_str('uni_name_submit'))
23
+    if (sys_get_param_str('uni_name_submit'))
24 24
     {
25 25
       $uni_row['universe_name'] = strip_tags(sys_get_param_str('uni_name'));
26 26
 
27 27
       $uni_price = sys_get_param_float('uni_price');
28
-      if($uni_price < $uni_row['universe_price'])
28
+      if ($uni_price < $uni_row['universe_price'])
29 29
       {
30 30
         throw new exception($lang['uni_msg_error_low_price'], ERR_ERROR);
31 31
       }
@@ -34,12 +34,12 @@  discard block
 block discarded – undo
34 34
       sn_db_transaction_start();
35 35
       $user = db_user_by_id($user['id'], true);
36 36
       // if($user[get_unit_param(RES_DARK_MATTER, P_NAME)] < $uni_price)
37
-      if(mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price)
37
+      if (mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price)
38 38
       {
39 39
         throw new exception($lang['uni_msg_error_no_dm'], ERR_ERROR);
40 40
       }
41 41
 
42
-      if(!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to " . sys_get_param_str_unsafe('uni_name')))
42
+      if (!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to " . sys_get_param_str_unsafe('uni_name')))
43 43
       {
44 44
         throw new exception($lang['sys_msg_err_update_dm'], ERR_ERROR);
45 45
       }
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
@@ -29,14 +29,14 @@  discard block
 block discarded – undo
29 29
   'planet' => $target_planet = sys_get_param_int('planet'),
30 30
 );
31 31
 
32
-if(!uni_coordinates_valid($target_coord))
32
+if (!uni_coordinates_valid($target_coord))
33 33
 {
34 34
   die($lang['gs_c02']);
35 35
 }
36 36
 
37 37
 $target_mission = sys_get_param_int('mission');
38 38
 $sn_group_missions = sn_get_groups('missions');
39
-if(!isset($sn_group_missions[$target_mission]['AJAX']) || !$sn_group_missions[$target_mission]['AJAX'])
39
+if (!isset($sn_group_missions[$target_mission]['AJAX']) || !$sn_group_missions[$target_mission]['AJAX'])
40 40
 {
41 41
   die($lang['gs_c00']);
42 42
 }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 $target_coord['planet_type'] = $target_planet_check;
53 53
 $target_row = DBStaticPlanet::db_planet_by_vector($target_coord);
54 54
 
55
-if(empty($target_row))
55
+if (empty($target_row))
56 56
 {
57 57
   $target_row = array(
58 58
     'galaxy' => $target_coord['galaxy'],
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 }
65 65
 
66 66
 $fleet_array = array();
67
-switch($target_mission)
67
+switch ($target_mission)
68 68
 {
69 69
   case MT_SPY:
70 70
     // $fleet_array[SHIP_SPY] = min(mrc_get_level($user, $planetrow, SHIP_SPY), abs($user['spio_anz']));
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
   break;
74 74
 
75 75
   case MT_RECYCLE:
76
-    foreach(sn_get_groups('flt_recyclers') as $unit_id)
76
+    foreach (sn_get_groups('flt_recyclers') as $unit_id)
77 77
     {
78
-      if($unit_count = mrc_get_level($user, $planetrow, $unit_id))
78
+      if ($unit_count = mrc_get_level($user, $planetrow, $unit_id))
79 79
       {
80 80
         $fleet_array[$unit_id] = $unit_count;
81 81
       }
@@ -96,14 +96,14 @@  discard block
 block discarded – undo
96 96
 $cant_attack = flt_can_attack($planetrow, $target_row, $fleet_array, $target_mission, $options);
97 97
 
98 98
 
99
-if($cant_attack != ATTACK_ALLOWED)
99
+if ($cant_attack != ATTACK_ALLOWED)
100 100
 {
101 101
   die($lang['fl_attack_error'][$cant_attack]);
102 102
 }
103 103
 
104
-$FleetDBArray   = array();
104
+$FleetDBArray = array();
105 105
 $db_changeset = array();
106
-foreach($fleet_array as $unit_id => $unit_count)
106
+foreach ($fleet_array as $unit_id => $unit_count)
107 107
 {
108 108
   $FleetDBArray[] = "{$unit_id},{$unit_count}";
109 109
   $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($unit_id, -$unit_count, $user, $planetrow);
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
 $fleet_ship_count = array_sum($fleet_array);
114 114
 
115
-if($target_mission == MT_MISSILE)
115
+if ($target_mission == MT_MISSILE)
116 116
 {
117 117
   $distance = abs($target_coord['system'] - $planetrow['system']);
118 118
   $duration = round((30 + (60 * $distance)) / flt_server_flight_speed_multiplier());
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 {
131 131
   $travel_data = flt_travel_data($user, $planetrow, $target_coord, $fleet_array, 10);
132 132
 
133
-  if($planetrow['deuterium'] < $travel_data['consumption'])
133
+  if ($planetrow['deuterium'] < $travel_data['consumption'])
134 134
   {
135 135
     die($lang['gs_c13']);
136 136
   }
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 $ships_sent = array();
190 190
 //$ships_sent_js = array();
191 191
 $ships_sent_js = 0;
192
-foreach($fleet_array as $unit_id => $unit_count)
192
+foreach ($fleet_array as $unit_id => $unit_count)
193 193
 {
194 194
   $ships_sent[] = "{$unit_count} {$lang['tech'][$unit_id]}";
195 195
   $ships_sent_js += mrc_get_level($user, $planetrow, $unit_id, false, true);
@@ -198,6 +198,6 @@  discard block
 block discarded – undo
198 198
 //$ships_sent_js = implode(',', $ships_sent_js);
199 199
 $ships_sent_js = "{$unit_group}={$ships_sent_js}";
200 200
 
201
-$ResultMessage  = "{$lang['gs_sending']} {$ships_sent} {$lang['gs_to']} {$target_coord['galaxy']}:{$target_coord['system']}:{$target_coord['planet']}|{$ships_sent_js}";
201
+$ResultMessage = "{$lang['gs_sending']} {$ships_sent} {$lang['gs_to']} {$target_coord['galaxy']}:{$target_coord['system']}:{$target_coord['planet']}|{$ships_sent_js}";
202 202
 
203 203
 die($ResultMessage);
Please login to merge, or discard this patch.