Test Failed
Push — trunk ( b3f953...fb036a )
by SuperNova.WS
05:47
created
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/includes/flt_page4.inc 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -3,18 +3,18 @@  discard block
 block discarded – undo
3 3
 use Fleet\DbFleetStatic;
4 4
 use Planet\DBStaticPlanet;
5 5
 
6
-if(SN_IN_FLEET !== true) {
6
+if (SN_IN_FLEET !== true) {
7 7
   $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403);
8 8
 }
9 9
 
10 10
 $fleetid = sys_get_param_id('fleetid');
11 11
 
12
-if(!is_numeric($fleetid) || empty($fleetid)) {
12
+if (!is_numeric($fleetid) || empty($fleetid)) {
13 13
   sys_redirect("fleet.php");
14 14
 }
15 15
 
16 16
 $fleet = DbFleetStatic::db_fleet_get($fleetid);
17
-if(!$fleet) {
17
+if (!$fleet) {
18 18
   SnTemplate::messageBox($lang['fl_fleet_not_exists'], $lang['fl_error']);
19 19
 }
20 20
 
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
   SnTemplate::messageBox($lang['fl_isback'], $lang['fl_error']);
23 23
 }
24 24
 
25
-if($fleet['fleet_owner'] != $user['id']) {
26
-  $debug->warning($lang['fl_aks_hack_wrong_fleet'],'Wrong Fleet Owner',301);
25
+if ($fleet['fleet_owner'] != $user['id']) {
26
+  $debug->warning($lang['fl_aks_hack_wrong_fleet'], 'Wrong Fleet Owner', 301);
27 27
   SnTemplate::messageBox($lang['fl_aks_hack_wrong_fleet'], $lang['fl_error']);
28 28
 }
29 29
 
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
   'MISSION_NAME' => $lang['type_mission'][MT_AKS],
58 58
 ));
59 59
 
60
-if($aks['eingeladen'] && is_array($members = db_user_list("`id` in ({$aks['eingeladen']})")) && !empty($members)) {
61
-  foreach($members as $row) {
60
+if ($aks['eingeladen'] && is_array($members = db_user_list("`id` in ({$aks['eingeladen']})")) && !empty($members)) {
61
+  foreach ($members as $row) {
62 62
     $template->assign_block_vars('invited', array(
63 63
       'NAME' => $row['username'],
64 64
     ));
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 $i++;
69 69
 $fleet_row = DbFleetStatic::db_fleet_get($fleetid);
70 70
 
71
-if(is_array($fleet_row) && !empty($fleet_row)) {
71
+if (is_array($fleet_row) && !empty($fleet_row)) {
72 72
 $planet_start = DBStaticPlanet::db_planet_by_id($fleet_row['fleet_start_planet_id']);
73 73
 $fleet_row['fleet_start_name'] = !empty($planet_start['name']) ? $planet_start['name'] : '';
74 74
 $planet_end = DBStaticPlanet::db_planet_by_id($fleet_row['fleet_end_planet_id']);
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
 $fleet_data = tpl_parse_fleet_db($fleet_row, $i, $user);
78 78
 $template->assign_block_vars('fleets', $fleet_data['fleet']);
79
-foreach($fleet_data['ships'] as $ship_data) {
79
+foreach ($fleet_data['ships'] as $ship_data) {
80 80
   $template->assign_block_vars('fleets.ships', $ship_data);
81 81
 }
82 82
 }
Please login to merge, or discard this patch.
includes/includes/flt_page1.inc 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -4,18 +4,18 @@  discard block
 block discarded – undo
4 4
 use Fleet\FleetStatic;
5 5
 use Planet\DBStaticPlanet;
6 6
 
7
-if(SN_IN_FLEET !== true) {
7
+if (SN_IN_FLEET !== true) {
8 8
   $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403);
9 9
 }
10 10
 
11 11
 $template = SnTemplate::gettemplate('fleet1', true);
12 12
 
13 13
 $ships = sys_get_param('ships', array());
14
-if(!is_array($ships)) {
14
+if (!is_array($ships)) {
15 15
   $ships = array();
16 16
 }
17 17
 
18
-foreach(array(PT_PLANET, PT_DEBRIS, PT_MOON) as $possible_planet_type_id) {
18
+foreach (array(PT_PLANET, PT_DEBRIS, PT_MOON) as $possible_planet_type_id) {
19 19
   $template->assign_block_vars('possible_planet_type_id', array(
20 20
     'ID' => $possible_planet_type_id,
21 21
     'NAME' => $lang['sys_planet_type_sh'][$possible_planet_type_id],
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
   'START_NAME'         => $planetrow['name'],
29 29
 );
30 30
 
31
-if(!empty($TargetPlanet)) {
31
+if (!empty($TargetPlanet)) {
32 32
   $template_route += array(
33 33
     'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$TargetPlanet['planet_type']],
34 34
     'END_COORDS'       => uni_render_coordinates($TargetPlanet),
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
 $template->assign_block_vars('fleets', $template_route);
40 40
 
41 41
 $sn_groups_fleet = sn_get_groups('fleet');
42
-foreach($ships as $ship_id => $ship_count) {
43
-  if(in_array($ship_id, $sn_groups_fleet) && $ship_count) {
42
+foreach ($ships as $ship_id => $ship_count) {
43
+  if (in_array($ship_id, $sn_groups_fleet) && $ship_count) {
44 44
     $ship_info = get_unit_param($ship_id);
45
-    if($ship_count > mrc_get_level($user, $planetrow, $ship_id, false, true)) {
45
+    if ($ship_count > mrc_get_level($user, $planetrow, $ship_id, false, true)) {
46 46
       $page .= $lang['fl_noenought'];
47 47
     } else {
48 48
       $fleet['fleetarray'][$ship_id]  = $ship_count;
@@ -61,13 +61,13 @@  discard block
 block discarded – undo
61 61
   }
62 62
 }
63 63
 
64
-if(empty($fleet['fleetarray'])) {
64
+if (empty($fleet['fleetarray'])) {
65 65
   SnTemplate::messageBox($lang['fl_err_no_ships'], $lang['fl_error'], 'fleet' . DOT_PHP_EX, 5);
66 66
 }
67 67
 
68 68
 // Building list of shortcuts
69 69
 $query = doquery("SELECT * FROM {{notes}} WHERE `owner` = {$user['id']} AND `galaxy` <> 0 AND `system` <> 0 AND `planet` <> 0 ORDER BY `priority` DESC, `galaxy`, `system`, `planet`, `planet_type`;");
70
-while($shortcut = db_fetch($query)) {
70
+while ($shortcut = db_fetch($query)) {
71 71
   $template->assign_block_vars('shortcut', array(
72 72
     'NAME'       => $shortcut['title'],
73 73
     'GALAXY'     => $shortcut['galaxy'],
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
 }
82 82
 
83 83
 // Building list of own planets & moons
84
-$colonies = DBStaticPlanet::db_planet_list_sorted ( $user );
85
-if(count($colonies) > 1) {
84
+$colonies = DBStaticPlanet::db_planet_list_sorted($user);
85
+if (count($colonies) > 1) {
86 86
   // while($row = db_fetch($colonies))
87
-  foreach($colonies as $row) {
87
+  foreach ($colonies as $row) {
88 88
     $template->assign_block_vars('colonies', array(
89 89
       'NAME'       => $row['name'],
90 90
       'GALAXY'     => $row['galaxy'],
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
 //ACS Start
100 100
 //Need to look for acs attacks.
101 101
 $aks_madnessred = DbFleetStatic::dbAcsGetAll();
102
-while($row = db_fetch($aks_madnessred)) {
102
+while ($row = db_fetch($aks_madnessred)) {
103 103
   $members = explode(',', $row['eingeladen']);
104
-  foreach($members as $a => $b) {
104
+  foreach ($members as $a => $b) {
105 105
     if ($b == $user['id']) {
106 106
       $template->assign_block_vars('acss', array(
107 107
         'ID'         => $row['id'],
Please login to merge, or discard this patch.
includes/includes/ube_report.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -109,33 +109,33 @@  discard block
 block discarded – undo
109 109
       `ube_report_time_combat` = '" . date(FMT_DATE_TIME_SQL, $combat_data[UBE_TIME]) . "',
110 110
       `ube_report_time_spent` = {$combat_data[UBE_TIME_SPENT]},
111 111
 
112
-      `ube_report_combat_admin` = " . (int)$combat_data[UBE_OPTIONS][UBE_COMBAT_ADMIN] . ",
112
+      `ube_report_combat_admin` = " . (int) $combat_data[UBE_OPTIONS][UBE_COMBAT_ADMIN] . ",
113 113
       `ube_report_mission_type` = {$combat_data[UBE_OPTIONS][UBE_MISSION_TYPE]},
114 114
 
115 115
       `ube_report_combat_result` = {$outcome[UBE_COMBAT_RESULT]},
116
-      `ube_report_combat_sfr` = " . (int)$outcome[UBE_SFR] . ",
116
+      `ube_report_combat_sfr` = " . (int) $outcome[UBE_SFR] . ",
117 117
 
118
-      `ube_report_debris_metal` = " . (float)$outcome[UBE_DEBRIS][RES_METAL] . ",
119
-      `ube_report_debris_crystal` = " . (float)$outcome[UBE_DEBRIS][RES_CRYSTAL] . ",
118
+      `ube_report_debris_metal` = " . (float) $outcome[UBE_DEBRIS][RES_METAL] . ",
119
+      `ube_report_debris_crystal` = " . (float) $outcome[UBE_DEBRIS][RES_CRYSTAL] . ",
120 120
       `ube_report_debris_total_in_metal` = " . $ube_report_debris_total_in_metal . ",
121 121
 
122
-      `ube_report_planet_id`          = " . (int)$outcome[UBE_PLANET][PLANET_ID] . ",
122
+      `ube_report_planet_id`          = " . (int) $outcome[UBE_PLANET][PLANET_ID] . ",
123 123
       `ube_report_planet_name`        = '" . SN::$db->db_escape($outcome[UBE_PLANET][PLANET_NAME]) . "',
124
-      `ube_report_planet_size`        = " . (int)$outcome[UBE_PLANET][PLANET_SIZE] . ",
125
-      `ube_report_planet_galaxy`      = " . (int)$outcome[UBE_PLANET][PLANET_GALAXY] . ",
126
-      `ube_report_planet_system`      = " . (int)$outcome[UBE_PLANET][PLANET_SYSTEM] . ",
127
-      `ube_report_planet_planet`      = " . (int)$outcome[UBE_PLANET][PLANET_PLANET] . ",
128
-      `ube_report_planet_planet_type` = " . (int)$outcome[UBE_PLANET][PLANET_TYPE] . ",
124
+      `ube_report_planet_size`        = " . (int) $outcome[UBE_PLANET][PLANET_SIZE] . ",
125
+      `ube_report_planet_galaxy`      = " . (int) $outcome[UBE_PLANET][PLANET_GALAXY] . ",
126
+      `ube_report_planet_system`      = " . (int) $outcome[UBE_PLANET][PLANET_SYSTEM] . ",
127
+      `ube_report_planet_planet`      = " . (int) $outcome[UBE_PLANET][PLANET_PLANET] . ",
128
+      `ube_report_planet_planet_type` = " . (int) $outcome[UBE_PLANET][PLANET_TYPE] . ",
129 129
 
130
-      `ube_report_moon` = " . (int)$outcome[UBE_MOON] . ",
131
-      `ube_report_moon_chance` = " . (int)$outcome[UBE_MOON_CHANCE] . ",
132
-      `ube_report_moon_size` = " . (float)$outcome[UBE_MOON_SIZE] . ",
130
+      `ube_report_moon` = " . (int) $outcome[UBE_MOON] . ",
131
+      `ube_report_moon_chance` = " . (int) $outcome[UBE_MOON_CHANCE] . ",
132
+      `ube_report_moon_size` = " . (float) $outcome[UBE_MOON_SIZE] . ",
133 133
 
134
-      `ube_report_moon_reapers` = " . (int)$outcome[UBE_MOON_REAPERS] . ",
135
-      `ube_report_moon_destroy_chance` = " . (int)$outcome[UBE_MOON_DESTROY_CHANCE] . ",
136
-      `ube_report_moon_reapers_die_chance` = " . (int)$outcome[UBE_MOON_REAPERS_DIE_CHANCE] . ",
134
+      `ube_report_moon_reapers` = " . (int) $outcome[UBE_MOON_REAPERS] . ",
135
+      `ube_report_moon_destroy_chance` = " . (int) $outcome[UBE_MOON_DESTROY_CHANCE] . ",
136
+      `ube_report_moon_reapers_die_chance` = " . (int) $outcome[UBE_MOON_REAPERS_DIE_CHANCE] . ",
137 137
 
138
-      `ube_report_capture_result` = " . (int)$outcome[UBE_CAPTURE_RESULT] . "
138
+      `ube_report_capture_result` = " . (int) $outcome[UBE_CAPTURE_RESULT] . "
139 139
   ");
140 140
   $ube_report_id = $combat_data[UBE_REPORT_ID] = SN::$db->db_insert_id();
141 141
 
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
       $player_id,
147 147
 
148 148
       "'" . SN::$db->db_escape($player_info[UBE_NAME]) . "'",
149
-      (int)$player_info[UBE_ATTACKER],
149
+      (int) $player_info[UBE_ATTACKER],
150 150
 
151
-      (float)$player_info[UBE_BONUSES][UBE_ATTACK],
152
-      (float)$player_info[UBE_BONUSES][UBE_SHIELD],
153
-      (float)$player_info[UBE_BONUSES][UBE_ARMOR],
151
+      (float) $player_info[UBE_BONUSES][UBE_ATTACK],
152
+      (float) $player_info[UBE_BONUSES][UBE_SHIELD],
153
+      (float) $player_info[UBE_BONUSES][UBE_ARMOR],
154 154
     );
155 155
   }
156 156
 
@@ -163,20 +163,20 @@  discard block
 block discarded – undo
163 163
       $fleet_info[UBE_OWNER],
164 164
       $fleet_id,
165 165
 
166
-      (float)$fleet_info[UBE_PLANET][PLANET_ID],
166
+      (float) $fleet_info[UBE_PLANET][PLANET_ID],
167 167
       "'" . SN::$db->db_escape($fleet_info[UBE_PLANET][PLANET_NAME]) . "'",
168
-      (int)$fleet_info[UBE_PLANET][PLANET_GALAXY],
169
-      (int)$fleet_info[UBE_PLANET][PLANET_SYSTEM],
170
-      (int)$fleet_info[UBE_PLANET][PLANET_PLANET],
171
-      (int)$fleet_info[UBE_PLANET][PLANET_TYPE],
172
-
173
-      (float)$fleet_info[UBE_RESOURCES][RES_METAL],
174
-      (float)$fleet_info[UBE_RESOURCES][RES_CRYSTAL],
175
-      (float)$fleet_info[UBE_RESOURCES][RES_DEUTERIUM],
176
-
177
-      (float)$fleet_info[UBE_BONUSES][UBE_ATTACK],
178
-      (float)$fleet_info[UBE_BONUSES][UBE_SHIELD],
179
-      (float)$fleet_info[UBE_BONUSES][UBE_ARMOR],
168
+      (int) $fleet_info[UBE_PLANET][PLANET_GALAXY],
169
+      (int) $fleet_info[UBE_PLANET][PLANET_SYSTEM],
170
+      (int) $fleet_info[UBE_PLANET][PLANET_PLANET],
171
+      (int) $fleet_info[UBE_PLANET][PLANET_TYPE],
172
+
173
+      (float) $fleet_info[UBE_RESOURCES][RES_METAL],
174
+      (float) $fleet_info[UBE_RESOURCES][RES_CRYSTAL],
175
+      (float) $fleet_info[UBE_RESOURCES][RES_DEUTERIUM],
176
+
177
+      (float) $fleet_info[UBE_BONUSES][UBE_ATTACK],
178
+      (float) $fleet_info[UBE_BONUSES][UBE_SHIELD],
179
+      (float) $fleet_info[UBE_BONUSES][UBE_ARMOR],
180 180
     );
181 181
 
182 182
     // Сохраняем итоговую информацию по ресурсам флота - потеряно, выброшено, увезено
@@ -185,19 +185,19 @@  discard block
 block discarded – undo
185 185
       $ube_report_id,
186 186
       $fleet_id,
187 187
 
188
-      (float)$fleet_outcome_data[UBE_RESOURCES_LOST][RES_METAL],
189
-      (float)$fleet_outcome_data[UBE_RESOURCES_LOST][RES_CRYSTAL],
190
-      (float)$fleet_outcome_data[UBE_RESOURCES_LOST][RES_DEUTERIUM],
188
+      (float) $fleet_outcome_data[UBE_RESOURCES_LOST][RES_METAL],
189
+      (float) $fleet_outcome_data[UBE_RESOURCES_LOST][RES_CRYSTAL],
190
+      (float) $fleet_outcome_data[UBE_RESOURCES_LOST][RES_DEUTERIUM],
191 191
 
192
-      (float)$fleet_outcome_data[UBE_CARGO_DROPPED][RES_METAL],
193
-      (float)$fleet_outcome_data[UBE_CARGO_DROPPED][RES_CRYSTAL],
194
-      (float)$fleet_outcome_data[UBE_CARGO_DROPPED][RES_DEUTERIUM],
192
+      (float) $fleet_outcome_data[UBE_CARGO_DROPPED][RES_METAL],
193
+      (float) $fleet_outcome_data[UBE_CARGO_DROPPED][RES_CRYSTAL],
194
+      (float) $fleet_outcome_data[UBE_CARGO_DROPPED][RES_DEUTERIUM],
195 195
 
196
-      (float)$fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_METAL],
197
-      (float)$fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_CRYSTAL],
198
-      (float)$fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_DEUTERIUM],
196
+      (float) $fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_METAL],
197
+      (float) $fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_CRYSTAL],
198
+      (float) $fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_DEUTERIUM],
199 199
 
200
-      (float)$fleet_outcome_data[UBE_RESOURCES_LOST_IN_METAL][RES_METAL],
200
+      (float) $fleet_outcome_data[UBE_RESOURCES_LOST_IN_METAL][RES_METAL],
201 201
     );
202 202
 
203 203
     // Сохраняем результаты по юнитам - потеряно и восстановлено
@@ -209,8 +209,8 @@  discard block
 block discarded – undo
209 209
           $fleet_id,
210 210
 
211 211
           $unit_id,
212
-          (float)$fleet_outcome_data[UBE_DEFENCE_RESTORE][$unit_id],
213
-          (float)$fleet_outcome_data[UBE_UNITS_LOST][$unit_id],
212
+          (float) $fleet_outcome_data[UBE_DEFENCE_RESTORE][$unit_id],
213
+          (float) $fleet_outcome_data[UBE_UNITS_LOST][$unit_id],
214 214
 
215 215
           $unit_sort_order,
216 216
         );
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 
234 234
           $unit_id,
235 235
           $unit_count,
236
-          (int)$fleet_data[UBE_UNITS_BOOM][$unit_id],
236
+          (int) $fleet_data[UBE_UNITS_BOOM][$unit_id],
237 237
 
238 238
           $fleet_data[UBE_ATTACK][$unit_id],
239 239
           $fleet_data[UBE_SHIELD][$unit_id],
Please login to merge, or discard this patch.
includes/includes/user_birthday_celebrate.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 
9 9
   $query = db_user_list_to_celebrate($config->user_birthday_range);
10 10
 
11
-  while($row = db_fetch($query))
11
+  while ($row = db_fetch($query))
12 12
   {
13 13
     $row['username'] = SN::$db->db_escape($row['username']);
14 14
     rpg_points_change($row['id'], RPG_BIRTHDAY, $config->user_birthday_gift, "Birthday gift for user {$row['username']} ID {$row['id']} on his birthday on {$row['user_birthday']}. Gift last gaved at {$row['user_birthday_celebrated']}");
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,7 @@
 block discarded – undo
2 2
 
3 3
 use DBAL\db_mysql;
4 4
 
5
-function sn_user_birthday_celebrate()
6
-{
5
+function sn_user_birthday_celebrate() {
7 6
   global $config, $lang;
8 7
 
9 8
   db_mysql::db_transaction_start();
Please login to merge, or discard this patch.
includes/alliance/ali_external_create_ally.inc 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 // Pretty Safe
3 3
 // TODO: Add ally_tag to usertable
4 4
 
5
-if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
5
+if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)
6 6
 {
7 7
   $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
8 8
 }
@@ -12,15 +12,15 @@  discard block
 block discarded – undo
12 12
 $ally_name_raw = sys_get_param_str_unsafe('name');
13 13
 $ally_name     = SN::$db->db_escape($ally_name_raw);
14 14
 
15
-if($ally_tag)
15
+if ($ally_tag)
16 16
 {
17
-  if(!$ally_name_raw || !$ally_tag_raw)
17
+  if (!$ally_name_raw || !$ally_tag_raw)
18 18
   {
19 19
     SnTemplate::messageBox($lang['have_not_name'], $lang['make_alliance']);
20 20
   }
21 21
 
22 22
   $query = doquery("SELECT ally_tag FROM {{alliance}} WHERE `ally_tag` = '{$ally_tag}' or `ally_name` = '{$ally_name}' LIMIT 1;", true);
23
-  if($query)
23
+  if ($query)
24 24
   {
25 25
     SnTemplate::messageBox(str_replace('%s', $query['ally_tag'] == $ally_tag_raw ? $ally_tag_raw : $ally_name_raw, $lang['always_exist']), $lang['make_alliance']);
26 26
   }
Please login to merge, or discard this patch.
includes/alliance/ali_internal_admin_request.inc 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 use Alliance\DBStaticAlly;
4 4
 
5
-if(!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) {
5
+if (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true) {
6 6
   $debug->error("Attempt to call ALLIANCE page mode {$mode} directly - not from alliance.php", 'Forbidden', 403);
7 7
 }
8 8
 
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 }
12 12
 
13 13
 $d = sys_get_param_id('d');
14
-if($d) {
14
+if ($d) {
15 15
   doquery("UPDATE {{alliance_requests}} SET `request_denied` = 1, `request_text` = '{$lang['ali_req_deny_reason']}' WHERE `id_user`= {$d} LIMIT 1;");
16 16
 }
17 17
 
18 18
 $id_user = sys_get_param_id('id_user');
19
-if($id_user) {
19
+if ($id_user) {
20 20
   $ally_name_safe = SN::$db->db_escape($ally['ally_name']);
21 21
   $ally_tag_safe = SN::$db->db_escape($ally['ally_tag']);
22 22
   db_user_set_by_id($id_user, "`ally_id` = '{$ally['id']}', `ally_name` = '{$ally_name_safe}', `ally_tag` = '{$ally_tag_safe}', `ally_register_time` = " . SN_TIME_NOW . ", `ally_rank_id` = 0");
Please login to merge, or discard this patch.
includes/general/general_urlAndHttp.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -116,11 +116,11 @@
 block discarded – undo
116 116
   );
117 117
 
118 118
   // Quick hack to support IPv6 at least on local host
119
-  if($ip['ip'] == '::1') {
119
+  if ($ip['ip'] == '::1') {
120 120
     $ip['ip'] = '127.0.0.1';
121 121
   }
122 122
 
123
-  foreach($ip as &$val) {
123
+  foreach ($ip as &$val) {
124 124
     $val = SN::$db->db_escape($val);
125 125
   }
126 126
 
Please login to merge, or discard this patch.
classes/Unit/DBStaticUnit.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
     $unit_snid = intval($unit_snid);
46 46
 
47
-    $resultOld = $unit_snid ? (isset($allUnits[$unit_snid]) ? $allUnits[$unit_snid] : null ) : $allUnits;
47
+    $resultOld = $unit_snid ? (isset($allUnits[$unit_snid]) ? $allUnits[$unit_snid] : null) : $allUnits;
48 48
 
49 49
     return $resultOld;
50 50
   }
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
   }
88 88
 
89 89
   public static function db_unit_count_by_user_and_type_and_snid($user_id, $unit_type = 0, $unit_snid = 0) {
90
-    $query  = doquery(
90
+    $query = doquery(
91 91
       "SELECT unit_snid, sum(unit_level) as `qty`  FROM {{unit}} WHERE `unit_player_id` = {$user_id} " .
92 92
       ($unit_type ? "AND `unit_type` = {$unit_type} " : '') .
93 93
       ($unit_snid ? "AND `unit_snid` = {$unit_snid} " : '') .
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
    * @return bool
237 237
    */
238 238
   protected static function dbAdd($playerId, $planetId, $unitSnId, $amount) {
239
-    if (!in_array($unitSnId, sn_get_groups([UNIT_SHIPS_STR, UNIT_DEFENCE_STR, UNIT_ARTIFACTS_STR, UNIT_STRUCTURES_STR,]))) {
239
+    if (!in_array($unitSnId, sn_get_groups([UNIT_SHIPS_STR, UNIT_DEFENCE_STR, UNIT_ARTIFACTS_STR, UNIT_STRUCTURES_STR, ]))) {
240 240
       return false;
241 241
     }
242 242
 
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 //        'unit_level'         => $level,
270 270
 //      ]);
271 271
 
272
-      $fields     += [
272
+      $fields += [
273 273
         'unit_type'  => get_unit_param($unitSnId, P_UNIT_TYPE),
274 274
         'unit_level' => $amount,
275 275
       ];
Please login to merge, or discard this patch.