Completed
Push — work-fleets ( f5fbda...1bdd41 )
by SuperNova.WS
06:04
created
includes/classes/UBE/UBEReport.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
   /**
8 8
    * @param UBE $ube
9 9
    *
10
-   * @return bool|string
10
+   * @return false|string
11 11
    *
12 12
    * @version 2016-02-25 23:42:45 41a4.68
13 13
    */
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
   // ------------------------------------------------------------------------------------------------
187 187
   // Читает боевой отчет из БД
188 188
   /**
189
-   * @param $report_cypher
189
+   * @param string $report_cypher
190 190
    *
191 191
    * @return string|UBE
192 192
    */
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -15,14 +15,14 @@  discard block
 block discarded – undo
15 15
     global $config;
16 16
 
17 17
     // Если уже есть ИД репорта - значит репорт был взят из таблицы. С таким мы не работаем
18
-    if($ube->get_cypher()) {
18
+    if ($ube->get_cypher()) {
19 19
       return false;
20 20
     }
21 21
 
22 22
     // Генерируем уникальный секретный ключ и проверяем наличие в базе
23 23
     do {
24 24
       $ube->report_cypher = sys_random_string(32);
25
-    } while(doquery("SELECT ube_report_cypher FROM {{ube_report}} WHERE ube_report_cypher = '{$ube->report_cypher}' LIMIT 1 FOR UPDATE", true));
25
+    } while (doquery("SELECT ube_report_cypher FROM {{ube_report}} WHERE ube_report_cypher = '{$ube->report_cypher}' LIMIT 1 FOR UPDATE", true));
26 26
 
27 27
     // Инициализация таблицы для пакетной вставки информации
28 28
     $sql_perform = array(
@@ -113,21 +113,21 @@  discard block
 block discarded – undo
113 113
       `ube_report_time_combat` = '" . date(FMT_DATE_TIME_SQL, $ube->combat_timestamp) . "',
114 114
       `ube_report_time_spent` = {$ube->time_spent},
115 115
 
116
-      `ube_report_combat_admin` = " . (int)$ube->is_admin_in_combat . ",
116
+      `ube_report_combat_admin` = " . (int) $ube->is_admin_in_combat . ",
117 117
       `ube_report_mission_type` = {$ube->mission_type_id},
118 118
 
119 119
       `ube_report_combat_result` = {$ube->combat_result},
120
-      `ube_report_combat_sfr` = " . (int)$ube->is_small_fleet_recce . ",
120
+      `ube_report_combat_sfr` = " . (int) $ube->is_small_fleet_recce . ",
121 121
 
122
-      `ube_report_planet_id`          = " . (int)$ube->ube_planet_info[PLANET_ID] . ",
122
+      `ube_report_planet_id`          = " . (int) $ube->ube_planet_info[PLANET_ID] . ",
123 123
       `ube_report_planet_name`        = '" . db_escape($ube->ube_planet_info[PLANET_NAME]) . "',
124
-      `ube_report_planet_size`        = " . (int)$ube->ube_planet_info[PLANET_SIZE] . ",
125
-      `ube_report_planet_galaxy`      = " . (int)$ube->ube_planet_info[PLANET_GALAXY] . ",
126
-      `ube_report_planet_system`      = " . (int)$ube->ube_planet_info[PLANET_SYSTEM] . ",
127
-      `ube_report_planet_planet`      = " . (int)$ube->ube_planet_info[PLANET_PLANET] . ",
128
-      `ube_report_planet_planet_type` = " . (int)$ube->ube_planet_info[PLANET_TYPE] . ",
124
+      `ube_report_planet_size`        = " . (int) $ube->ube_planet_info[PLANET_SIZE] . ",
125
+      `ube_report_planet_galaxy`      = " . (int) $ube->ube_planet_info[PLANET_GALAXY] . ",
126
+      `ube_report_planet_system`      = " . (int) $ube->ube_planet_info[PLANET_SYSTEM] . ",
127
+      `ube_report_planet_planet`      = " . (int) $ube->ube_planet_info[PLANET_PLANET] . ",
128
+      `ube_report_planet_planet_type` = " . (int) $ube->ube_planet_info[PLANET_TYPE] . ",
129 129
 
130
-      `ube_report_capture_result` = " . (int)$ube->capture_result . ", "
130
+      `ube_report_capture_result` = " . (int) $ube->capture_result . ", "
131 131
       . $ube->debris->report_generate_sql($config)
132 132
       . $ube->moon_calculator->report_generate_sql();
133 133
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
     // Сохраняем общую информацию по игрокам
138 138
     $player_sides = $ube->players->get_player_sides();
139
-    foreach($player_sides as $player_id => $player_side) {
139
+    foreach ($player_sides as $player_id => $player_side) {
140 140
       $sql_perform['ube_report_player'][] = array(
141 141
         $ube_report_id,
142 142
         $player_id,
@@ -144,14 +144,14 @@  discard block
 block discarded – undo
144 144
         "'" . db_escape($ube->players[$player_id]->name) . "'",
145 145
         $ube->players[$player_id]->getSide() == UBE_PLAYER_IS_ATTACKER ? 1 : 0,
146 146
 
147
-        (float)$ube->players[$player_id]->player_bonus->calcBonus(P_ATTACK),
148
-        (float)$ube->players[$player_id]->player_bonus->calcBonus(P_SHIELD),
149
-        (float)$ube->players[$player_id]->player_bonus->calcBonus(P_ARMOR),
147
+        (float) $ube->players[$player_id]->player_bonus->calcBonus(P_ATTACK),
148
+        (float) $ube->players[$player_id]->player_bonus->calcBonus(P_SHIELD),
149
+        (float) $ube->players[$player_id]->player_bonus->calcBonus(P_ARMOR),
150 150
       );
151 151
     }
152 152
 
153 153
     // Всякая информация по флотам
154
-    foreach($ube->fleet_list->_container as $fleet_id => $UBEFleet) {
154
+    foreach ($ube->fleet_list->_container as $fleet_id => $UBEFleet) {
155 155
       // Сохраняем общую информацию по флотам
156 156
       $sql_perform['ube_report_fleet'][] = $UBEFleet->sql_generate_array($ube_report_id);
157 157
 
@@ -167,11 +167,11 @@  discard block
 block discarded – undo
167 167
     $ube->rounds->sql_generate_unit_array($sql_perform['ube_report_unit'], $ube_report_id, $ube->fleet_list);
168 168
 
169 169
     // Пакетная вставка данных
170
-    foreach($sql_perform as $table_name => $table_data) {
171
-      if(count($table_data) < 2) {
170
+    foreach ($sql_perform as $table_name => $table_data) {
171
+      if (count($table_data) < 2) {
172 172
         continue;
173 173
       }
174
-      foreach($table_data as &$record_data) {
174
+      foreach ($table_data as &$record_data) {
175 175
         $record_data = '(' . implode(',', $record_data) . ')';
176 176
       }
177 177
       $fields = $table_data[0];
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
     $report_cypher = db_escape($report_cypher);
195 195
 
196 196
     $report_row = doquery("SELECT * FROM {{ube_report}} WHERE ube_report_cypher = '{$report_cypher}' LIMIT 1", true);
197
-    if(!$report_row) {
197
+    if (!$report_row) {
198 198
       return UBE_REPORT_NOT_FOUND;
199 199
     }
200 200
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
    * @param     $template_result
211 211
    */
212 212
   function sn_ube_report_generate(UBE $ube, &$template_result) {
213
-    if(!is_object($ube)) {
213
+    if (!is_object($ube)) {
214 214
       return;
215 215
     }
216 216
 
@@ -227,15 +227,15 @@  discard block
 block discarded – undo
227 227
 
228 228
     // Координаты, тип и название планеты - если есть
229 229
 //R  $planet_owner_id = $combat_data[UBE_FLEETS][0][UBE_OWNER];
230
-    if(isset($ube->ube_planet_info)) {
230
+    if (isset($ube->ube_planet_info)) {
231 231
       $template_result += $ube->ube_planet_info;
232 232
       $template_result[PLANET_NAME] = str_replace(' ', '&nbsp;', htmlentities($template_result[PLANET_NAME], ENT_COMPAT, 'UTF-8'));
233 233
     }
234 234
 
235 235
     // Обломки
236 236
     $debris = array();
237
-    foreach(array(RES_METAL, RES_CRYSTAL) as $resource_id) {
238
-      if($resource_amount = $ube->debris->debris_get_resource($resource_id)) {
237
+    foreach (array(RES_METAL, RES_CRYSTAL) as $resource_id) {
238
+      if ($resource_amount = $ube->debris->debris_get_resource($resource_id)) {
239 239
         $debris[] = array(
240 240
           'NAME'   => $lang['tech'][$resource_id],
241 241
           'AMOUNT' => pretty_number($resource_amount),
Please login to merge, or discard this patch.
includes/db/db_queries_ally.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -293,7 +293,7 @@
 block discarded – undo
293 293
 }
294 294
 
295 295
 /**
296
- * @param $ranklist
296
+ * @param string $ranklist
297 297
  * @param $user
298 298
  */
299 299
 function db_ally_update_ranklist($ranklist, $user) {
Please login to merge, or discard this patch.
includes/db/db_queries_chat.php 1 patch
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
 
18 18
 /**
19 19
  * @param $user_id
20
- * @param $nick
20
+ * @param string $nick
21 21
  * @param $ally_id
22
- * @param $message
22
+ * @param string $message
23 23
  * @param $chat_message_sender_name
24 24
  * @param $chat_message_recipient_id
25 25
  * @param $chat_message_recipient_name
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
  * @param $alliance
56 56
  * @param $where_add
57 57
  * @param $start_row
58
- * @param $page_limit
58
+ * @param integer $page_limit
59 59
  *
60 60
  * @return array|bool|mysqli_result|null
61 61
  */
Please login to merge, or discard this patch.
includes/db/db_queries_fleet.php 2 patches
Doc Comments   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,6 +22,10 @@  discard block
 block discarded – undo
22 22
   doquery('DELETE FROM `{{aks}}` WHERE `id` NOT IN (SELECT DISTINCT `fleet_group` FROM `{{fleets}}`);');
23 23
 }
24 24
 
25
+/**
26
+ * @param double $arrival
27
+ * @param integer $target_structure
28
+ */
25 29
 function db_missile_insert($target_coord, $user, $planetrow, $arrival, $fleet_ship_count, $target_structure) {
26 30
   doquery(
27 31
     "INSERT INTO `{{iraks}}` SET
@@ -114,14 +118,14 @@  discard block
 block discarded – undo
114 118
 
115 119
 
116 120
 /**
117
- * @param $fleet_group_id_list
121
+ * @param string $fleet_group_id_list
118 122
  */
119 123
 function db_acs_delete_by_list($fleet_group_id_list) {
120 124
   doquery("DELETE FROM {{aks}} WHERE `id` IN ({$fleet_group_id_list})");
121 125
 }
122 126
 
123 127
 /**
124
- * @param $bashing_list
128
+ * @param string $bashing_list
125 129
  */
126 130
 function db_bashing_insert($bashing_list) {
127 131
   doquery("INSERT INTO {{bashing}} (bashing_user_id, bashing_planet_id, bashing_time) VALUES {$bashing_list};");
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * DB ACS functions
4
- */
3
+     * DB ACS functions
4
+     */
5 5
 
6 6
 /* ACS ****************************************************************************************************************/
7 7
 /**
Please login to merge, or discard this patch.
includes/db/db_queries_news_and_surveys.php 1 patch
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
 }
80 80
 
81 81
 /**
82
- * @param $template
83
- * @param $query_where
84
- * @param $query_limit
82
+ * @param template $template
83
+ * @param string $query_where
84
+ * @param integer $query_limit
85 85
  *
86 86
  * @return array|bool|mysqli_result|null
87 87
  */
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
  * @param $user
106 106
  * @param $survey_id
107 107
  * @param $survey_vote_id
108
- * @param $user_name_safe
108
+ * @param string $user_name_safe
109 109
  */
110 110
 function db_survey_vote_insert(&$user, $survey_id, $survey_vote_id, $user_name_safe) {
111 111
   doquery("INSERT INTO {{survey_votes}} SET `survey_parent_id` = {$survey_id}, `survey_parent_answer_id` = {$survey_vote_id}, `survey_vote_user_id` = {$user['id']}, `survey_vote_user_name` = '{$user_name_safe}';");
Please login to merge, or discard this patch.
includes/functions/int_fleet_events.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,8 +69,8 @@
 block discarded – undo
69 69
 
70 70
 /**
71 71
  * @param Fleet $objFleet
72
- * @param       $ov_label
73
- * @param       $planet_end_type
72
+ * @param       integer $ov_label
73
+ * @param       integer $planet_end_type
74 74
  *
75 75
  * @return mixed
76 76
  */
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,26 +6,26 @@  discard block
 block discarded – undo
6 6
   $fleet_events = array();
7 7
   $fleet_number = 0;
8 8
 
9
-  if($objFleetList->count() <= 0) {
9
+  if ($objFleetList->count() <= 0) {
10 10
     return;
11 11
   }
12 12
 
13
-  foreach($objFleetList->_container as $objFleet) {
13
+  foreach ($objFleetList->_container as $objFleet) {
14 14
     $planet_start_type = $objFleet->fleet_start_type == PT_MOON ? PT_MOON : PT_PLANET;
15 15
     $planet_start = db_planet_by_gspt($objFleet->fleet_start_galaxy, $objFleet->fleet_start_system, $objFleet->fleet_start_planet, $planet_start_type, false, 'name');
16 16
     $objFleet->fleet_start_name = $planet_start['name'];
17 17
 
18 18
     $planet_end_type = $objFleet->fleet_end_type == PT_MOON ? PT_MOON : PT_PLANET;
19
-    if($objFleet->fleet_end_planet > classSupernova::$config->game_maxPlanet) {
19
+    if ($objFleet->fleet_end_planet > classSupernova::$config->game_maxPlanet) {
20 20
       $objFleet->fleet_end_name = classLocale::$lang['ov_fleet_exploration'];
21
-    } elseif($objFleet->mission_type == MT_COLONIZE) {
21
+    } elseif ($objFleet->mission_type == MT_COLONIZE) {
22 22
       $objFleet->fleet_end_name = classLocale::$lang['ov_fleet_colonization'];
23 23
     } else {
24 24
       $planet_end = db_planet_by_gspt($objFleet->fleet_end_galaxy, $objFleet->fleet_end_system, $objFleet->fleet_end_planet, $planet_end_type, false, 'name');
25 25
       $objFleet->fleet_end_name = $planet_end['name'];
26 26
     }
27 27
 
28
-    if($objFleet->time_arrive_to_target > SN_TIME_NOW && !$objFleet->isReturning() && $objFleet->mission_type != MT_MISSILE &&
28
+    if ($objFleet->time_arrive_to_target > SN_TIME_NOW && !$objFleet->isReturning() && $objFleet->mission_type != MT_MISSILE &&
29 29
       ($planet_scanned === false
30 30
         ||
31 31
         (
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
       $fleet_events[] = flt_register_event_objFleet($objFleet, 0, $planet_end_type);
40 40
     }
41 41
 
42
-    if($objFleet->time_mission_job_complete > SN_TIME_NOW && !$objFleet->isReturning() && $planet_scanned === false && $objFleet->mission_type != MT_MISSILE) {
42
+    if ($objFleet->time_mission_job_complete > SN_TIME_NOW && !$objFleet->isReturning() && $planet_scanned === false && $objFleet->mission_type != MT_MISSILE) {
43 43
       $fleet_events[] = flt_register_event_objFleet($objFleet, 1, $planet_end_type);
44 44
     }
45 45
 
46
-    if(
46
+    if (
47 47
       $objFleet->time_return_to_source > SN_TIME_NOW && $objFleet->mission_type != MT_MISSILE && ($objFleet->isReturning() || ($objFleet->mission_type != MT_RELOCATE && $objFleet->mission_type != MT_COLONIZE)) &&
48 48
       (
49 49
         ($planet_scanned === false && $objFleet->playerOwnerId == $user['id'])
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
       $fleet_events[] = flt_register_event_objFleet($objFleet, 2, $planet_end_type);
60 60
     }
61 61
 
62
-    if($objFleet->mission_type == MT_MISSILE) {
62
+    if ($objFleet->mission_type == MT_MISSILE) {
63 63
       $fleet_events[] = flt_register_event_objFleet($objFleet, 3, $planet_end_type);
64 64
     }
65 65
   }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
   $is_this_planet = false;
81 81
 
82
-  switch($objFleet->ov_label = $ov_label) {
82
+  switch ($objFleet->ov_label = $ov_label) {
83 83
     case 0:
84 84
       $objFleet->event_time = $objFleet->time_arrive_to_target;
85 85
       $is_this_planet = (
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 
111 111
   }
112 112
 
113
-  $objFleet->ov_this_planet = $is_this_planet;// || $planet_scanned != false;
113
+  $objFleet->ov_this_planet = $is_this_planet; // || $planet_scanned != false;
114 114
 
115
-  if($objFleet->playerOwnerId == $user['id']) {
115
+  if ($objFleet->playerOwnerId == $user['id']) {
116 116
     $user_data = $user;
117 117
   } else {
118 118
     $user_data = db_user_by_id($objFleet->playerOwnerId);
Please login to merge, or discard this patch.
includes/functions/tpl_helpers.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -185,6 +185,9 @@
 block discarded – undo
185 185
   return $result;
186 186
 }
187 187
 
188
+/**
189
+ * @param integer $que_id
190
+ */
188 191
 function tpl_parse_planet_que($que, $planet, $que_id) {
189 192
   $hangar_que = array();
190 193
   $que_hangar = $que['ques'][$que_id][$planet['id_owner']][$planet['id']];
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@  discard block
 block discarded – undo
2 2
 
3 3
 // Compare function to sort fleet in time order
4 4
 function tpl_assign_fleet_compare($a, $b) {
5
-  if($a['fleet']['OV_THIS_PLANET'] == $b['fleet']['OV_THIS_PLANET']) {
6
-    if($a['fleet']['OV_LEFT'] == $b['fleet']['OV_LEFT']) {
5
+  if ($a['fleet']['OV_THIS_PLANET'] == $b['fleet']['OV_THIS_PLANET']) {
6
+    if ($a['fleet']['OV_LEFT'] == $b['fleet']['OV_LEFT']) {
7 7
       return 0;
8 8
     }
9 9
 
@@ -19,17 +19,17 @@  discard block
 block discarded – undo
19 19
  * @param string   $js_name
20 20
  */
21 21
 function tpl_assign_fleet(&$template, $fleets, $js_name = 'fleets') {
22
-  if(!$fleets) {
22
+  if (!$fleets) {
23 23
     return;
24 24
   }
25 25
 
26 26
   usort($fleets, 'tpl_assign_fleet_compare');
27 27
 
28
-  foreach($fleets as $fleet_data) {
28
+  foreach ($fleets as $fleet_data) {
29 29
     $template->assign_block_vars($js_name, $fleet_data['fleet']);
30 30
 
31
-    if($fleet_data['ships']) {
32
-      foreach($fleet_data['ships'] as $ship_data) {
31
+    if ($fleet_data['ships']) {
32
+      foreach ($fleet_data['ships'] as $ship_data) {
33 33
         $template->assign_block_vars("{$js_name}.ships", $ship_data);
34 34
       }
35 35
     }
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
     'DEUTERIUM' => $fleet[RES_DEUTERIUM],
51 51
   );
52 52
 
53
-  foreach($fleet as $ship_id => $ship_amount) {
54
-    if(in_array($ship_id, sn_get_groups('fleet'))) {
53
+  foreach ($fleet as $ship_id => $ship_amount) {
54
+    if (in_array($ship_id, sn_get_groups('fleet'))) {
55 55
       $single_ship_data = get_ship_data($ship_id, $user_data);
56 56
       $return['ships'][$ship_id] = array(
57 57
         'ID'          => $ship_id,
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 
91 91
   $result = array();
92 92
 
93
-  if(!$user_data) {
93
+  if (!$user_data) {
94 94
     $user_data = $user;
95 95
   }
96 96
 
97
-  if(!$objFleet->isReturning() && $objFleet->mission_type == MT_AKS) {
97
+  if (!$objFleet->isReturning() && $objFleet->mission_type == MT_AKS) {
98 98
     $aks = db_acs_get_by_group_id($objFleet->group_id);
99 99
   }
100 100
 
@@ -135,14 +135,14 @@  discard block
 block discarded – undo
135 135
     'STAY_LEFT' => floor($objFleet->time_mission_job_complete + 1 - SN_TIME_NOW),
136 136
   );
137 137
 
138
-  if(property_exists($objFleet, 'fleet_start_name')) {
138
+  if (property_exists($objFleet, 'fleet_start_name')) {
139 139
     $result['START_NAME'] = $objFleet->fleet_start_name;
140 140
   }
141
-  if(property_exists($objFleet, 'fleet_end_name')) {
141
+  if (property_exists($objFleet, 'fleet_end_name')) {
142 142
     $result['END_NAME'] = $objFleet->fleet_end_name;
143 143
   }
144 144
 
145
-  if(property_exists($objFleet, 'event_time')) {
145
+  if (property_exists($objFleet, 'event_time')) {
146 146
     $result['fleet'] = array_merge($result['fleet'], array(
147 147
       'OV_LABEL'        => $objFleet->ov_label,
148 148
       'EVENT_TIME_TEXT' => property_exists($objFleet, 'event_time') ? date(FMT_DATE_TIME, $objFleet->event_time + SN_CLIENT_TIME_DIFF) : '',
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
   $ship_list_fully_parsed = $objFleet->shipsGetArray();
155 155
 
156 156
   $ship_id = 0;
157
-  if($spy_level >= 6) {
158
-    foreach($ship_list_fully_parsed as $ship_sn_id => $ship_amount) {
159
-      if($spy_level >= 10) {
157
+  if ($spy_level >= 6) {
158
+    foreach ($ship_list_fully_parsed as $ship_sn_id => $ship_amount) {
159
+      if ($spy_level >= 10) {
160 160
         $single_ship_data = get_ship_data($ship_sn_id, $user_data);
161 161
         $result['ships'][$ship_sn_id] = array(
162 162
           'ID'          => $ship_sn_id,
@@ -188,8 +188,8 @@  discard block
 block discarded – undo
188 188
 function tpl_parse_planet_que($que, $planet, $que_id) {
189 189
   $hangar_que = array();
190 190
   $que_hangar = $que['ques'][$que_id][$planet['id_owner']][$planet['id']];
191
-  if(!empty($que_hangar)) {
192
-    foreach($que_hangar as $que_item) {
191
+  if (!empty($que_hangar)) {
192
+    foreach ($que_hangar as $que_item) {
193 193
       $hangar_que['que'][] = array('id' => $que_item['que_unit_id'], 'count' => $que_item['que_unit_amount']);
194 194
       $hangar_que[$que_item['que_unit_id']] += $que_item['que_unit_amount'];
195 195
     }
@@ -252,10 +252,10 @@  discard block
 block discarded – undo
252 252
     'PLANET_GOVERNOR_LEVEL_MAX' => get_unit_param($planet['PLANET_GOVERNOR_ID'], P_MAX_STACK),
253 253
   );
254 254
 
255
-  if(!empty($que['ques'][QUE_STRUCTURES][$planet['id_owner']][$planet['id']])) {
255
+  if (!empty($que['ques'][QUE_STRUCTURES][$planet['id_owner']][$planet['id']])) {
256 256
     $result['building_que'] = array();
257 257
     $building_que = &$que['ques'][QUE_STRUCTURES][$planet['id_owner']][$planet['id']];
258
-    foreach($building_que as $que_element) {
258
+    foreach ($building_que as $que_element) {
259 259
       $result['building_que'][] = que_tpl_parse_element($que_element);
260 260
     }
261 261
   }
@@ -271,19 +271,19 @@  discard block
 block discarded – undo
271 271
 function flt_get_fleets_to_planet_by_array_of_Fleet($array_of_Fleet) {
272 272
   global $user;
273 273
 
274
-  if(empty($array_of_Fleet)) {
274
+  if (empty($array_of_Fleet)) {
275 275
     return false;
276 276
   }
277 277
 
278 278
   $fleet_list = array();
279
-  foreach($array_of_Fleet as $fleet) {
280
-    if($fleet->playerOwnerId == $user['id']) {
281
-      if($fleet->mission_type == MT_MISSILE) {
279
+  foreach ($array_of_Fleet as $fleet) {
280
+    if ($fleet->playerOwnerId == $user['id']) {
281
+      if ($fleet->mission_type == MT_MISSILE) {
282 282
         continue;
283 283
       }
284 284
       $fleet_ownage = 'own';
285 285
     } else {
286
-      switch($fleet->mission_type) {
286
+      switch ($fleet->mission_type) {
287 287
         case MT_ATTACK:
288 288
         case MT_AKS:
289 289
         case MT_DESTROY:
@@ -300,10 +300,10 @@  discard block
 block discarded – undo
300 300
 
301 301
     $fleet_list[$fleet_ownage]['fleets'][$fleet->dbId] = $fleet;
302 302
 
303
-    if($fleet->isReturning() || (!$fleet->isReturning() && $fleet->mission_type == MT_RELOCATE) || ($fleet->target_owner_id != $user['id'])) {
303
+    if ($fleet->isReturning() || (!$fleet->isReturning() && $fleet->mission_type == MT_RELOCATE) || ($fleet->target_owner_id != $user['id'])) {
304 304
       $fleet_sn = $fleet->shipsGetArray();
305
-      foreach($fleet_sn as $ship_id => $ship_amount) {
306
-        if(in_array($ship_id, sn_get_groups('fleet'))) {
305
+      foreach ($fleet_sn as $ship_id => $ship_amount) {
306
+        if (in_array($ship_id, sn_get_groups('fleet'))) {
307 307
           $fleet_list[$fleet_ownage]['total'][$ship_id] += $ship_amount;
308 308
         }
309 309
       }
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
   return $fleet_list;
321 321
 }
322 322
 
323
-function tpl_set_resource_info(template &$template, $planet_row, $fleets_to_planet = array(), $round = 0) {
323
+function tpl_set_resource_info(template & $template, $planet_row, $fleets_to_planet = array(), $round = 0) {
324 324
   $template->assign_vars(array(
325 325
     'RESOURCE_ROUNDING' => $round,
326 326
 
Please login to merge, or discard this patch.
includes/includes/coe_simulator_helpers.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
+/**
4
+ * @param string $type
5
+ */
3 6
 function sn_ube_simulator_encode_replay($combat, $type)
4 7
 {
5 8
   $strPacked = "{$type}!";
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@  discard block
 block discarded – undo
4 4
 {
5 5
   $strPacked = "{$type}!";
6 6
 
7
-  foreach($combat as $fleetID => $fleetCompress)
7
+  foreach ($combat as $fleetID => $fleetCompress)
8 8
   {
9
-    foreach($fleetCompress as $key => $value)
9
+    foreach ($fleetCompress as $key => $value)
10 10
     {
11 11
       $value = intval($value);
12 12
       $strPacked .= "{$key},{$value};";
@@ -22,29 +22,29 @@  discard block
 block discarded – undo
22 22
   $fleet_id = 0;
23 23
 
24 24
   $arr_data_unpacked = explode('!', $str_data);
25
-  foreach($arr_data_unpacked as $data_piece)
25
+  foreach ($arr_data_unpacked as $data_piece)
26 26
   {
27
-    if(!$data_piece)
27
+    if (!$data_piece)
28 28
     {
29 29
       continue;
30 30
     }
31 31
 
32
-    if($data_piece == 'A' || $data_piece == 'D')
32
+    if ($data_piece == 'A' || $data_piece == 'D')
33 33
     {
34 34
       $fleet_type = $data_piece;
35 35
       continue;
36 36
     }
37 37
 
38 38
     $arr_unit_strings = explode(';', $data_piece);
39
-    foreach($arr_unit_strings as $str_unit_string)
39
+    foreach ($arr_unit_strings as $str_unit_string)
40 40
     {
41
-      if(!$str_unit_string)
41
+      if (!$str_unit_string)
42 42
       {
43 43
         continue;
44 44
       }
45 45
 
46 46
       $arr_unit_data = explode(',', $str_unit_string);
47
-      if($arr_unit_data[1])
47
+      if ($arr_unit_data[1])
48 48
       {
49 49
         $unpacked[$fleet_type][$fleet_id][$arr_unit_data[0]] = intval($arr_unit_data[1]);
50 50
       }
Please login to merge, or discard this patch.
includes/includes/flt_mission_attack.php 2 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,9 +10,8 @@
 block discarded – undo
10 10
 
11 11
 /**
12 12
  * @param Mission $objMission
13
- * @param array   $mission_data
14 13
  *
15
- * @return array|null
14
+ * @return null|boolean
16 15
  */
17 16
 function flt_mission_attack($objMission) {
18 17
   $objFleet = $objMission->fleet;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@
 block discarded – undo
17 17
 function flt_mission_attack($objMission) {
18 18
   $objFleet = $objMission->fleet;
19 19
 
20
-  if($objFleet->shipsGetTotal() <= 0) {
20
+  if ($objFleet->shipsGetTotal() <= 0) {
21 21
     return null;
22 22
   }
23 23
 
24 24
   $destination_user = $objMission->dst_user;
25 25
   $destination_planet = $objMission->dst_planet;
26 26
 
27
-  if(
27
+  if (
28 28
     // Нет данных о планете назначения или её владельце
29 29
     empty($destination_user) || empty($destination_planet) || !is_array($destination_user) || !is_array($destination_planet)
30 30
     ||
Please login to merge, or discard this patch.