Test Failed
Branch trunk (d809b8)
by SuperNova.WS
05:48
created
includes/functions/msg_send_simple_message.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@  discard block
 block discarded – undo
15 15
    1.5 - copyright (c) 2010-2011 by Gorlum for http://supernova.ws
16 16
          [+] SuperMassMailing - authlevel=3 player can send messages to whole server ('*' as $owners)
17 17
  */
18
-function msg_ali_send($message, $subject, $ally_rank_id = 0, $ally_id = 0)
19
-{
18
+function msg_ali_send($message, $subject, $ally_rank_id = 0, $ally_id = 0) {
20 19
   global $user;
21 20
 
22 21
   $ally_id = $ally_id ? $ally_id : $user['ally_id'];
@@ -37,8 +36,7 @@  discard block
 block discarded – undo
37 36
   return $list;
38 37
 }
39 38
 
40
-function msg_send_simple_message($owners, $sender, $timestamp, $message_type, $from, $subject, $text, $escaped = false, $force = false)
41
-{
39
+function msg_send_simple_message($owners, $sender, $timestamp, $message_type, $from, $subject, $text, $escaped = false, $force = false) {
42 40
   global $config, $user, $sn_message_class_list;
43 41
 
44 42
   if(!$owners)
@@ -79,8 +77,7 @@  discard block
 block discarded – undo
79 77
     // TODO Добавить $sender - рассылка может быть и от кого-то
80 78
     db_message_insert_all($message_type, $from, $subject, $text);
81 79
     $owners = array();
82
-  }
83
-  else
80
+  } else
84 81
   {
85 82
     $insert_values = array();
86 83
     $insert_template = "('%u'," . str_replace('%', '%%', " '{$sender}', '{$timestamp}', '{$message_type}', '{$from}', '{$subject}', '{$text}')");
@@ -90,8 +87,7 @@  discard block
 block discarded – undo
90 87
       if($user['id'] != $owner)
91 88
       {
92 89
         $owner_row = db_user_by_id($owner);
93
-      }
94
-      else
90
+      } else
95 91
       {
96 92
         $owner_row = $user;
97 93
       }
Please login to merge, or discard this patch.
includes/includes/ube_report.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -2,8 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 // ------------------------------------------------------------------------------------------------
4 4
 // Записывает боевой отчет в БД
5
-function sn_ube_report_save(&$combat_data)
6
-{
5
+function sn_ube_report_save(&$combat_data) {
7 6
   global $config;
8 7
 
9 8
   // Если уже есть ИД репорта - значит репорт был взят из таблицы. С таким мы не работаем
@@ -281,8 +280,7 @@  discard block
 block discarded – undo
281 280
 
282 281
 // ------------------------------------------------------------------------------------------------
283 282
 // Читает боевой отчет из БД
284
-function sn_ube_report_load($report_cypher)
285
-{
283
+function sn_ube_report_load($report_cypher) {
286 284
   $report_cypher = db_escape($report_cypher);
287 285
 
288 286
   $report_row = doquery("SELECT * FROM {{ube_report}} WHERE ube_report_cypher = '{$report_cypher}' LIMIT 1", true);
@@ -480,8 +478,7 @@  discard block
 block discarded – undo
480 478
 
481 479
 // ------------------------------------------------------------------------------------------------
482 480
 // Парсит инфу о раунде для темплейта
483
-function sn_ube_report_round_fleet(&$combat_data, $round)
484
-{
481
+function sn_ube_report_round_fleet(&$combat_data, $round) {
485 482
   global $lang;
486 483
 
487 484
   $fleets_info = &$combat_data[UBE_FLEETS];
@@ -535,8 +532,7 @@  discard block
 block discarded – undo
535 532
 
536 533
 // ------------------------------------------------------------------------------------------------
537 534
 // Рендерит таблицу общего результата боя
538
-function sn_ube_report_table_render(&$array, $header)
539
-{
535
+function sn_ube_report_table_render(&$array, $header) {
540 536
   global $lang;
541 537
 
542 538
   $result = array();
@@ -563,8 +559,7 @@  discard block
 block discarded – undo
563 559
 
564 560
 // ------------------------------------------------------------------------------------------------
565 561
 // Генерирует данные для отчета из разобранных данных боя
566
-function sn_ube_report_generate(&$combat_data, &$template_result)
567
-{
562
+function sn_ube_report_generate(&$combat_data, &$template_result) {
568 563
   if(!is_array($combat_data))
569 564
   {
570 565
     return;
Please login to merge, or discard this patch.
includes/includes/flt_mission_hold.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-function flt_mission_hold(&$mission_data)
4
-{
3
+function flt_mission_hold(&$mission_data) {
5 4
   if($mission_data['fleet']['fleet_end_stay'] < SN_TIME_NOW)
6 5
   {
7 6
     fleet_send_back($mission_data['fleet']);
Please login to merge, or discard this patch.
includes/includes/flt_mission_spy.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -10,8 +10,7 @@  discard block
 block discarded – undo
10 10
  * @copyright 2008
11 11
  */
12 12
 // ----------------------------------------------------------------------------------------------------------------
13
-function coe_compress_add_units($unit_group, $target_planet, &$compress_data, $target_user = array())
14
-{
13
+function coe_compress_add_units($unit_group, $target_planet, &$compress_data, $target_user = array()) {
15 14
   foreach($unit_group as $unit_id)
16 15
   {
17 16
     if(($unit_count = mrc_get_level($target_user, $target_planet, $unit_id, false, true)) > 0)
@@ -29,8 +28,7 @@  discard block
 block discarded – undo
29 28
   }
30 29
 }
31 30
 
32
-function flt_spy_scan($target_planet, $group_name, $section_title, $target_user = array())
33
-{
31
+function flt_spy_scan($target_planet, $group_name, $section_title, $target_user = array()) {
34 32
   global $lang;
35 33
 
36 34
   $result = "<tr><td class=\"c\" colspan=\"4\">{$section_title}</td></tr>";
@@ -53,8 +51,7 @@  discard block
 block discarded – undo
53 51
   return $result;
54 52
 }
55 53
 
56
-function flt_mission_spy(&$mission_data)
57
-{
54
+function flt_mission_spy(&$mission_data) {
58 55
   global $lang;
59 56
 
60 57
   $fleet_row         = &$mission_data['fleet'];
@@ -132,8 +129,7 @@  discard block
 block discarded – undo
132 129
     {
133 130
       $spy_outcome_str = sprintf($lang['sys_mess_spy_detect_chance'], $spy_detected);
134 131
       $spy_detected = false;
135
-    }
136
-    else
132
+    } else
137 133
     {
138 134
       $spy_outcome_str = $lang['sys_mess_spy_destroyed'];
139 135
       $spy_detected = true;
@@ -168,8 +164,7 @@  discard block
 block discarded – undo
168 164
       $target_message .= "<br />{$lang['sys_mess_spy_destroyed_enemy']}";
169 165
 
170 166
       $result = CACHE_FLEET | CACHE_PLANET_DST;
171
-    }
172
-    else
167
+    } else
173 168
     {
174 169
       $result = CACHE_FLEET;
175 170
     }
Please login to merge, or discard this patch.
includes/includes/flt_mission_recycle.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -7,8 +7,7 @@  discard block
 block discarded – undo
7 7
  * @copyright 2008 By Chlorel for XNova
8 8
  */
9 9
 
10
-function flt_mission_recycle(&$mission_data)
11
-{
10
+function flt_mission_recycle(&$mission_data) {
12 11
   $fleet_row          = &$mission_data['fleet'];
13 12
   $destination_planet = &$mission_data['dst_planet'];
14 13
 
@@ -37,8 +36,7 @@  discard block
 block discarded – undo
37 36
       if(in_array($unit_id, sn_get_groups('flt_recyclers')))
38 37
       {
39 38
         $RecyclerCapacity += $capacity;
40
-      }
41
-      else
39
+      } else
42 40
       {
43 41
         $OtherFleetCapacity += $capacity;
44 42
       }
@@ -55,16 +53,14 @@  discard block
 block discarded – undo
55 53
   {
56 54
     $RecycledGoods["metal"]   = $destination_planet["debris_metal"];
57 55
     $RecycledGoods["crystal"] = $destination_planet["debris_crystal"];
58
-  }
59
-  else
56
+  } else
60 57
   {
61 58
     if (($destination_planet["debris_metal"]   > $RecyclerCapacity / 2) AND
62 59
       ($destination_planet["debris_crystal"] > $RecyclerCapacity / 2))
63 60
       {
64 61
       $RecycledGoods["metal"]   = $RecyclerCapacity / 2;
65 62
       $RecycledGoods["crystal"] = $RecyclerCapacity / 2;
66
-    }
67
-    else
63
+    } else
68 64
     {
69 65
       if ($destination_planet["debris_metal"] > $destination_planet["debris_crystal"])
70 66
       {
@@ -72,20 +68,17 @@  discard block
 block discarded – undo
72 68
         if ($destination_planet["debris_metal"] > ($RecyclerCapacity - $RecycledGoods["crystal"]))
73 69
         {
74 70
           $RecycledGoods["metal"] = $RecyclerCapacity - $RecycledGoods["crystal"];
75
-        }
76
-        else
71
+        } else
77 72
         {
78 73
           $RecycledGoods["metal"] = $destination_planet["debris_metal"];
79 74
         }
80
-      }
81
-      else
75
+      } else
82 76
       {
83 77
         $RecycledGoods["metal"] = $destination_planet["debris_metal"];
84 78
         if ($destination_planet["debris_crystal"] > ($RecyclerCapacity - $RecycledGoods["metal"]))
85 79
         {
86 80
           $RecycledGoods["crystal"] = $RecyclerCapacity - $RecycledGoods["metal"];
87
-        }
88
-        else
81
+        } else
89 82
         {
90 83
           $RecycledGoods["crystal"] = $destination_planet["debris_crystal"];
91 84
         }
Please login to merge, or discard this patch.
includes/includes/flt_mission_relocate.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,7 @@
 block discarded – undo
8 8
  * @version 1.1
9 9
  * @copyright 2008 by Chlorel for XNova
10 10
  */
11
-function flt_mission_relocate($mission_data)
12
-{
11
+function flt_mission_relocate($mission_data) {
13 12
   $fleet_row          = &$mission_data['fleet'];
14 13
   $destination_planet = &$mission_data['dst_planet'];
15 14
 
Please login to merge, or discard this patch.
includes/includes/user_birthday_celebrate.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-function sn_user_birthday_celebrate()
4
-{
3
+function sn_user_birthday_celebrate() {
5 4
   global $config, $lang;
6 5
 
7 6
   sn_db_transaction_start();
Please login to merge, or discard this patch.
includes/includes/coe_simulator_helpers.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-function sn_ube_simulator_encode_replay($combat, $type)
4
-{
3
+function sn_ube_simulator_encode_replay($combat, $type) {
5 4
   $strPacked = "{$type}!";
6 5
 
7 6
   foreach($combat as $fleetID => $fleetCompress)
@@ -17,8 +16,7 @@  discard block
 block discarded – undo
17 16
   return $strPacked;
18 17
 }
19 18
 
20
-function sn_ube_simulator_decode_replay($str_data)
21
-{
19
+function sn_ube_simulator_decode_replay($str_data) {
22 20
   $fleet_id = 0;
23 21
 
24 22
   $arr_data_unpacked = explode('!', $str_data);
@@ -58,8 +56,7 @@  discard block
 block discarded – undo
58 56
 
59 57
 // ------------------------------------------------------------------------------------------------
60 58
 // Преобразовывает данные симулятора в данные для расчета боя
61
-function sn_ube_simulator_fill_side(&$combat_data, $side_info, $attacker, $player_id = -1)
62
-{
59
+function sn_ube_simulator_fill_side(&$combat_data, $side_info, $attacker, $player_id = -1) {
63 60
   global $ube_convert_techs;
64 61
 
65 62
   $player_id = $player_id == -1 ? count($combat_data[UBE_PLAYERS]) : $player_id;
@@ -82,16 +79,13 @@  discard block
 block discarded – undo
82 79
       if($unit_type == UNIT_SHIPS || $unit_type == UNIT_DEFENCE)
83 80
       {
84 81
         $combat_data[UBE_FLEETS][$player_id][UBE_COUNT][$unit_id] = $unit_count;
85
-      }
86
-      elseif($unit_type == UNIT_RESOURCES)
82
+      } elseif($unit_type == UNIT_RESOURCES)
87 83
       {
88 84
         $combat_data[UBE_FLEETS][$player_id][UBE_RESOURCES][$unit_id] = $unit_count;
89
-      }
90
-      elseif($unit_type == UNIT_TECHNOLOGIES)
85
+      } elseif($unit_type == UNIT_TECHNOLOGIES)
91 86
       {
92 87
         $combat_data[UBE_PLAYERS][$player_id][UBE_BONUSES][$ube_convert_techs[$unit_id]] += $unit_count * get_unit_param($unit_id, P_BONUS_VALUE) / 100;
93
-      }
94
-      elseif($unit_type == UNIT_GOVERNORS)
88
+      } elseif($unit_type == UNIT_GOVERNORS)
95 89
       {
96 90
         if($unit_id == MRC_FORTIFIER)
97 91
         {
@@ -100,8 +94,7 @@  discard block
 block discarded – undo
100 94
             $combat_data[UBE_FLEETS][$player_id][UBE_BONUSES][$ube_id] += $unit_count * get_unit_param($unit_id, P_BONUS_VALUE) / 100;
101 95
           }
102 96
         }
103
-      }
104
-      elseif($unit_type == UNIT_MERCENARIES)
97
+      } elseif($unit_type == UNIT_MERCENARIES)
105 98
       {
106 99
         if($unit_id == MRC_ADMIRAL)
107 100
         {
@@ -115,8 +108,7 @@  discard block
 block discarded – undo
115 108
   }
116 109
 }
117 110
 
118
-function sn_ube_simulator_fleet_converter($sym_attacker, $sym_defender)
119
-{
111
+function sn_ube_simulator_fleet_converter($sym_attacker, $sym_defender) {
120 112
   $combat_data = array(
121 113
     UBE_OPTIONS => array(
122 114
       UBE_SIMULATOR => sys_get_param_int('simulator'),
Please login to merge, or discard this patch.
includes/includes/ube_zi_helpers.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-function sn_ube_combat_helper_round_header($round)
4
-{
3
+function sn_ube_combat_helper_round_header($round) {
5 4
   $header = array(
6 5
     'ИД1',
7 6
     'ИД2',
@@ -40,13 +39,11 @@  discard block
 block discarded – undo
40 39
   print('</tr>');
41 40
 }
42 41
 
43
-function sn_ube_combat_helper_round_footer($round = 0)
44
-{
42
+function sn_ube_combat_helper_round_footer($round = 0) {
45 43
   print('</table>');
46 44
 }
47 45
 
48
-function sn_ube_combat_helper_round_row(&$debug_unit_crossfire_result)
49
-{
46
+function sn_ube_combat_helper_round_row(&$debug_unit_crossfire_result) {
50 47
   $SN = array(
51 48
     SHIP_CARGO_SMALL => 'МаТр', SHIP_CARGO_BIG => 'БоТр', SHIP_CARGO_SUPER => 'СуТр', SHIP_CARGO_HYPER => 'ГпТр',
52 49
     SHIP_SATTELITE_SOLAR => 'СоСп', 
Please login to merge, or discard this patch.