Passed
Push — trunk ( e5589f...062c60 )
by SuperNova.WS
06:16
created
includes/includes/ube_attack_calculate.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -165,8 +165,7 @@  discard block
 block discarded – undo
165 165
     $planet_info[PLANET_SYSTEM],
166 166
     $planet_info[PLANET_PLANET],
167 167
     htmlentities($planet_info[PLANET_NAME], ENT_COMPAT, 'UTF-8'),
168
-    $lang[$outcome['UBE_COMBAT_RESULT'] == UBE_COMBAT_RESULT_WIN ? 'ube_report_info_outcome_win' :
169
-      ($outcome['UBE_COMBAT_RESULT'] == UBE_COMBAT_RESULT_DRAW ? 'ube_report_info_outcome_draw' : 'ube_report_info_outcome_loss')]
168
+    $lang[$outcome['UBE_COMBAT_RESULT'] == UBE_COMBAT_RESULT_WIN ? 'ube_report_info_outcome_win' : ($outcome['UBE_COMBAT_RESULT'] == UBE_COMBAT_RESULT_DRAW ? 'ube_report_info_outcome_draw' : 'ube_report_info_outcome_loss')]
170 169
   );
171 170
 
172 171
   $text_defender = '';
@@ -251,7 +250,7 @@  discard block
 block discarded – undo
251 250
       // Просматриваем результаты изменения флотов
252 251
       foreach ($fleet_info[UBE_COUNT] as $unit_id => $unit_count) {
253 252
         // Перебираем аутком на случай восстановления юнитов
254
-        $units_lost = (float)$fleets_outcome[$fleet_id][UBE_UNITS_LOST][$unit_id];
253
+        $units_lost = (float) $fleets_outcome[$fleet_id][UBE_UNITS_LOST][$unit_id];
255 254
 
256 255
         $units_left = $unit_count - $units_lost;
257 256
         if ($fleet_id) {
@@ -275,7 +274,7 @@  discard block
 block discarded – undo
275 274
     // Если во флоте остались юниты или это планета - генерируем изменение ресурсов
276 275
     if ($new_fleet_count || !$fleet_id) {
277 276
       foreach (sn_get_groups('resources_loot') as $resource_id) {
278
-        $resource_change = (float)$fleets_outcome[$fleet_id][UBE_RESOURCES_LOOTED][$resource_id] + (float)$fleets_outcome[$fleet_id][UBE_CARGO_DROPPED][$resource_id];
277
+        $resource_change = (float) $fleets_outcome[$fleet_id][UBE_RESOURCES_LOOTED][$resource_id] + (float) $fleets_outcome[$fleet_id][UBE_CARGO_DROPPED][$resource_id];
279 278
         if ($resource_change) {
280 279
           $resource_db_name = ($fleet_id ? 'fleet_resource_' : '') . pname_resource_name($resource_id);
281 280
           $fleet_delta[$resource_db_name] = -($resource_change);
Please login to merge, or discard this patch.
includes/includes/art_artifact.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 {
5 5
   global $lang;
6 6
 
7
-  if(!in_array($unit_id, sn_get_groups('artifacts')))
7
+  if (!in_array($unit_id, sn_get_groups('artifacts')))
8 8
   {
9 9
     return;
10 10
   }
@@ -13,17 +13,17 @@  discard block
 block discarded – undo
13 13
   $user = db_user_by_id($user['id'], true);
14 14
 
15 15
   $unit_level = $artifact_level_old = mrc_get_level($user, array(), $unit_id, true);
16
-  if($unit_level > 0)
16
+  if ($unit_level > 0)
17 17
   {
18 18
     $db_changeset = array();
19
-    switch($unit_id)
19
+    switch ($unit_id)
20 20
     {
21 21
       case ART_LHC:
22 22
       case ART_HOOK_SMALL:
23 23
       case ART_HOOK_MEDIUM:
24 24
       case ART_HOOK_LARGE:
25 25
         $has_moon = DBStaticPlanet::db_planet_by_parent($planetrow['id'], true, '`id`');
26
-        if($planetrow['planet_type'] == PT_PLANET && !$has_moon['id'])
26
+        if ($planetrow['planet_type'] == PT_PLANET && !$has_moon['id'])
27 27
         {
28 28
           $unit_level--;
29 29
           $updateDebris = false;
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             break;
45 45
           }
46 46
 
47
-          if($moonSize)
47
+          if ($moonSize)
48 48
           {
49 49
             $new_moon_row = uni_create_moon($planetrow['galaxy'], $planetrow['system'], $planetrow['planet'], $user['id'], $moonSize, $updateDebris);
50 50
             $message = sprintf($lang['art_moon_create'][$unit_id], $new_moon_row['name'], uni_render_coordinates($planetrow), HelperString::numberFloorAndFormat($moonSize));
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
       case ART_RCD_MEDIUM:
66 66
       case ART_RCD_LARGE:
67 67
         $planetrow = DBStaticPlanet::db_planet_by_id($planetrow['id'], true);
68
-        if($planetrow['planet_type'] != PT_PLANET)
68
+        if ($planetrow['planet_type'] != PT_PLANET)
69 69
         {
70 70
           $message = $lang['art_rcd_err_moon'];
71 71
           break;
72 72
         }
73 73
 
74 74
         $que = que_get($user['id'], $planetrow['id'], QUE_STRUCTURES, false);
75
-        if(!empty($que['items']))
75
+        if (!empty($que['items']))
76 76
         {
77 77
           $message = $lang['art_rcd_err_que'];
78 78
           break;
@@ -81,15 +81,15 @@  discard block
 block discarded – undo
81 81
         $artifact_deploy = get_unit_param($unit_id, P_DEPLOY);
82 82
 
83 83
         $sectors_used = 0;
84
-        foreach($artifact_deploy as $deploy_unit_id => $deploy_unit_level)
84
+        foreach ($artifact_deploy as $deploy_unit_id => $deploy_unit_level)
85 85
         {
86
-          if(!($levels_deployed = max(0, $deploy_unit_level - mrc_get_level($user, $planetrow, $deploy_unit_id, true, true))))
86
+          if (!($levels_deployed = max(0, $deploy_unit_level - mrc_get_level($user, $planetrow, $deploy_unit_id, true, true))))
87 87
             continue;
88 88
           $sectors_used += $levels_deployed;
89 89
           $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($deploy_unit_id, $levels_deployed, $user, $planetrow['id']);
90 90
         }
91 91
 
92
-        if($sectors_used == 0)
92
+        if ($sectors_used == 0)
93 93
         {
94 94
           $message = $lang['art_rcd_err_no_sense'];
95 95
           break;
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
         $que_item = null;
105 105
         $que = que_get($user['id'], $planetrow['id'], QUE_RESEARCH, true);
106 106
         $current_que = &$que['ques'][QUE_RESEARCH][$user['id']][0];
107
-        if(!empty($current_que))
107
+        if (!empty($current_que))
108 108
         {
109 109
           reset($current_que);
110 110
           $que_item = &$que['ques'][QUE_RESEARCH][$user['id']][0][key($current_que)];
111 111
         }
112 112
 
113
-        if(!empty($que_item) && $que_item['que_time_left'] > 60)
113
+        if (!empty($que_item) && $que_item['que_time_left'] > 60)
114 114
         {
115 115
           $unit_level--;
116 116
           $old_time = $que_item['que_time_left'];
@@ -131,13 +131,13 @@  discard block
 block discarded – undo
131 131
         $que = que_get($user['id'], $planetrow['id'], QUE_STRUCTURES, true);
132 132
         $current_que = &$que['ques'][QUE_STRUCTURES][$user['id']][$planetrow['id']];
133 133
         // $que_item = &$que['que'][QUE_STRUCTURES][0];
134
-        if(!empty($current_que))
134
+        if (!empty($current_que))
135 135
         {
136 136
           reset($current_que);
137 137
           $que_item = &$que['ques'][QUE_STRUCTURES][$user['id']][$planetrow['id']][key($current_que)];
138 138
         }
139 139
 
140
-        if(isset($que_item) && $que_item['que_time_left'] > 60)
140
+        if (isset($que_item) && $que_item['que_time_left'] > 60)
141 141
         {
142 142
           $unit_level--;
143 143
           $old_time = $que_item['que_time_left'];
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
       break;
156 156
 
157 157
     }
158
-    if($unit_level != $artifact_level_old)
158
+    if ($unit_level != $artifact_level_old)
159 159
     {
160 160
       $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($unit_id, $unit_level - $artifact_level_old, $user);
161 161
       OldDbChangeSet::db_changeset_apply($db_changeset);
Please login to merge, or discard this patch.
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.
includes/update.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -359,7 +359,7 @@
 block discarded – undo
359 359
       );
360 360
     }
361 361
 
362
-    updPatchApply(1, function () {
362
+    updPatchApply(1, function() {
363 363
       $q = upd_do_query("SELECT `messageid`, `user` FROM `{{chat}}`", true);
364 364
       while ($row = db_fetch($q)) {
365 365
         if (strpos($row['user'], 'a:') !== 0) {
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.
galaxy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     ||
126 126
     (!empty($uni_galaxyRowPlanet['destruyed']) && CheckAbandonPlanetState($uni_galaxyRowPlanet))
127 127
   ) {
128
-    $template->assign_block_vars('galaxyrow', ['PLANET_NUM' => $Planet,]);
128
+    $template->assign_block_vars('galaxyrow', ['PLANET_NUM' => $Planet, ]);
129 129
     continue;
130 130
   }
131 131
 
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
     'IS_CAPITAL'      => $uni_galaxyRowUser['id_planet'] == $uni_galaxyRowPlanet['id'],
243 243
 
244 244
     'USER_ID'         => $uni_galaxyRowUser['id'],
245
-    'USER_NAME'       => $renderedNick = player_nick_render_to_html($uni_galaxyRowUser, ['icons' => true,]),
245
+    'USER_NAME'       => $renderedNick = player_nick_render_to_html($uni_galaxyRowUser, ['icons' => true, ]),
246 246
     'USER_NAME_JS'    => js_safe_string($renderedNick),
247 247
     'USER_RANK'       => in_array($uni_galaxyRowUser['id'], $user_skip_list) ? '-' : $uni_galaxyRowUser['total_rank'],
248 248
     'USER_BANNED'     => $uni_galaxyRowUser['banaday'],
Please login to merge, or discard this patch.
time_probe.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@  discard block
 block discarded – undo
10 10
 $time_server = $time_local  - $time_diff
11 11
 */
12 12
 
13
-if($font_size = sys_get_param_str('font_size')) {
14
-  if(strpos($font_size, '%') !== false) {
13
+if ($font_size = sys_get_param_str('font_size')) {
14
+  if (strpos($font_size, '%') !== false) {
15 15
     // Размер шрифта в процентах
16 16
     $font_size = min(max(floatval($font_size), FONT_SIZE_PERCENT_MIN), FONT_SIZE_PERCENT_MAX) . '%';
17
-  } elseif(strpos($font_size, 'px') !== false) {
17
+  } elseif (strpos($font_size, 'px') !== false) {
18 18
     // Размер шрифта в пикселях
19 19
     $font_size = min(max(floatval($font_size), FONT_SIZE_PIXELS_MIN), FONT_SIZE_PIXELS_MAX) . 'px';
20 20
   } else {
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
   SN::$user_options[PLAYER_OPTION_BASE_FONT_SIZE] = $font_size;
27 27
 } else {
28 28
   $user_time_diff = playerTimeDiff::user_time_diff_get();
29
-  if($user_time_diff[PLAYER_OPTION_TIME_DIFF_FORCED]) {
29
+  if ($user_time_diff[PLAYER_OPTION_TIME_DIFF_FORCED]) {
30 30
     $time_diff = intval($user_time_diff[PLAYER_OPTION_TIME_DIFF]);
31 31
   } else {
32 32
     $user_time_diff = playerTimeDiff::user_time_diff_probe();
Please login to merge, or discard this patch.
search.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 include('common.' . substr(strrchr(__FILE__, '.'), 1));
14 14
 
15
-if(SN::$config->game_mode == GAME_BLITZ) {
15
+if (SN::$config->game_mode == GAME_BLITZ) {
16 16
   messageBox($lang['sys_blitz_page_disabled'], $lang['sys_error'], 'overview.php', 10);
17 17
   die();
18 18
 }
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 
26 26
 $template = gettemplate('search', true);
27 27
 
28
-if($searchtext && $type)
28
+if ($searchtext && $type)
29 29
 {
30
-  switch($type)
30
+  switch ($type)
31 31
   {
32 32
     case "planetname":
33 33
       // $search = db_planet_list_search($searchtext);
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
     break;
44 44
   }
45 45
 
46
-  while($row = db_fetch($search))
46
+  while ($row = db_fetch($search))
47 47
   {
48
-    if($type=='playername' || $type=='planetname')
48
+    if ($type == 'playername' || $type == 'planetname')
49 49
     {
50 50
       $template->assign_block_vars('search_result', array(
51 51
         'PLAYER_ID' => $row['uid'],
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         'ALLY_TAG' => htmlentities($row['ally_tag'], ENT_COMPAT, 'UTF-8'),
63 63
       ));
64 64
     }
65
-    elseif($type=='ally')
65
+    elseif ($type == 'ally')
66 66
     {
67 67
       $template->assign_block_vars('search_result', array(
68 68
         'ALLY_NAME' => htmlentities($row['ally_name'], ENT_COMPAT, 'UTF-8'),
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
   'ally' => 'sys_alliance',
82 82
 );
83 83
 
84
-foreach($search_type as $type_id => $type_lang)
84
+foreach ($search_type as $type_id => $type_lang)
85 85
 {
86 86
   $template->assign_block_vars('type', array(
87 87
     'ID' => $type_id,
Please login to merge, or discard this patch.