Completed
Push — trunk ( c8f413...ad61f6 )
by SuperNova.WS
04:45
created
dark_matter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 include_once('common.' . substr(strrchr(__FILE__, '.'), 1));
4 4
 
5
-if(sn_module::sn_module_get_active_count('payment') && !defined('SN_GOOGLE')) {
5
+if (sn_module::sn_module_get_active_count('payment') && !defined('SN_GOOGLE')) {
6 6
   sys_redirect('metamatter.php');
7 7
 }
8 8
 
Please login to merge, or discard this patch.
classes/Fleet/RecordFleet.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
   public function __construct(GlobalContainer $services = null) {
77 77
     parent::__construct($services);
78 78
 
79
-    if(empty(static::$shipInfo)) {
80
-      foreach(sn_get_groups('fleet') as $unit_id) {
79
+    if (empty(static::$shipInfo)) {
80
+      foreach (sn_get_groups('fleet') as $unit_id) {
81 81
         static::$shipInfo[$unit_id] = get_unit_param($unit_id);
82 82
         static::$shipInfo[$unit_id][P_COST_METAL] = get_unit_cost_in(static::$shipInfo[$unit_id][P_COST]);
83 83
       }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
    * @inheritdoc
104 104
    */
105 105
   public function update() {
106
-    if($this->getShipCount() < 1) {
106
+    if ($this->getShipCount() < 1) {
107 107
       return $this->delete();
108 108
     }
109 109
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
    */
128 128
   public function getCostInMetal() {
129 129
     $result = 0;
130
-    foreach($this->shipList as $shipId => $amount) {
130
+    foreach ($this->shipList as $shipId => $amount) {
131 131
       $result += $amount * $this->getShipCostInMetal($shipId);
132 132
     }
133 133
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
    */
149 149
   public function getCapacity() {
150 150
     $result = 0;
151
-    foreach($this->shipList as $shipId => $amount) {
151
+    foreach ($this->shipList as $shipId => $amount) {
152 152
       $result += $amount * $this->getShipCapacity($shipId);
153 153
     }
154 154
 
@@ -165,12 +165,12 @@  discard block
 block discarded – undo
165 165
    */
166 166
   public function changeShipCount($shipSnId, $shipCount) {
167 167
     !isset($this->shipList[$shipSnId]) ? $this->shipList[$shipSnId] = 0 : false;
168
-    if($this->shipList[$shipSnId] + $shipCount < 0) {
168
+    if ($this->shipList[$shipSnId] + $shipCount < 0) {
169 169
       throw new \Exception("Trying to deduct more ships [{$shipSnId}] '{$shipCount}' then fleet has {$this->shipList[$shipSnId]}");
170 170
     }
171 171
 
172 172
     $this->shipList[$shipSnId] += $shipCount;
173
-    if($this->shipList[$shipSnId] <= 0) {
173
+    if ($this->shipList[$shipSnId] <= 0) {
174 174
       unset($this->shipList[$shipSnId]);
175 175
     }
176 176
 
@@ -185,11 +185,11 @@  discard block
 block discarded – undo
185 185
    * @throws \Exception
186 186
    */
187 187
   public function changeResource($resourceId, $resourceCount) {
188
-    if(!array_key_exists($resourceId, $this->resources)) {
188
+    if (!array_key_exists($resourceId, $this->resources)) {
189 189
       return;
190 190
     }
191 191
 
192
-    if($this->resources[$resourceId] + $resourceCount < 0) {
192
+    if ($this->resources[$resourceId] + $resourceCount < 0) {
193 193
       throw new \Exception("Trying to deduct more resources [{$resourceId}] '{$resourceCount}' then fleet has {$this->resources[$resourceId]}");
194 194
     }
195 195
 
Please login to merge, or discard this patch.
classes/Fleet/MissionExplore.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
    *
34 34
    * @var int[] $shipsToRemove
35 35
    */
36
-  protected $shipsToRemove = [SHIP_COLONIZER, SHIP_SPY,];
36
+  protected $shipsToRemove = [SHIP_COLONIZER, SHIP_SPY, ];
37 37
 
38 38
   // -------------------------------------------------------------------------------------------------------------------
39 39
   /**
@@ -278,8 +278,7 @@  discard block
 block discarded – undo
278 278
     }
279 279
 
280 280
     // Adding outcome message to the front of other info
281
-    array_unshift($this->message, is_string($messages) ? $messages :
282
-      (is_array($messages) ? $messages[mt_rand(0, count($messages) - 1)] : ''));
281
+    array_unshift($this->message, is_string($messages) ? $messages : (is_array($messages) ? $messages[mt_rand(0, count($messages) - 1)] : ''));
283 282
   }
284 283
 
285 284
   /**
Please login to merge, or discard this patch.
classes/userOptions.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 
134 134
     $update_cache = false;
135 135
 
136
-    if(!empty($this->to_write)) {
137
-      foreach($this->to_write as $key => $cork) {
136
+    if (!empty($this->to_write)) {
137
+      foreach ($this->to_write as $key => $cork) {
138 138
         $value = is_array($this->data[$key]) ? serialize($this->data[$key]) : $this->data[$key]; // Сериализация для массивов при сохранении в БД
139 139
         $this->to_write[$key] = "({$this->user_id}, '" . db_escape($key) . "', '" . db_escape($value) . "')";
140 140
       }
@@ -145,18 +145,18 @@  discard block
 block discarded – undo
145 145
       $update_cache = true;
146 146
     }
147 147
 
148
-    if(!empty($this->to_delete)) {
149
-      foreach($this->to_delete as $key => &$value) {
150
-        $value = is_string($key) ? "'". db_escape($key) . "'" : $key;
148
+    if (!empty($this->to_delete)) {
149
+      foreach ($this->to_delete as $key => &$value) {
150
+        $value = is_string($key) ? "'" . db_escape($key) . "'" : $key;
151 151
       }
152 152
 
153
-      doquery("DELETE FROM `{{player_options}}` WHERE `player_id` = {$this->user_id} AND `option_id` IN (". implode(',', $this->to_delete) . ") ");
153
+      doquery("DELETE FROM `{{player_options}}` WHERE `player_id` = {$this->user_id} AND `option_id` IN (" . implode(',', $this->to_delete) . ") ");
154 154
 
155 155
       $this->to_delete = array();
156 156
       $update_cache = true;
157 157
     }
158 158
 
159
-    if($update_cache) {
159
+    if ($update_cache) {
160 160
       global $sn_cache;
161 161
 
162 162
       $field_name = $this->cached_name();
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
   protected function load() {
184 184
     global $sn_cache;
185 185
 
186
-    if($this->loaded) {
186
+    if ($this->loaded) {
187 187
       return;
188 188
     }
189 189
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
     $this->to_write = array();
192 192
     $this->to_delete = array();
193 193
 
194
-    if(!$this->user_id) {
194
+    if (!$this->user_id) {
195 195
       $this->loaded = true;
196 196
       return;
197 197
     }
@@ -199,13 +199,13 @@  discard block
 block discarded – undo
199 199
     $field_name = $this->cached_name();
200 200
     $a_data = $sn_cache->$field_name;
201 201
 
202
-    if(!empty($a_data)) {
202
+    if (!empty($a_data)) {
203 203
       $this->data = array_replace_recursive($this->data, $a_data);
204 204
       return;
205 205
     }
206 206
 
207 207
     $query = doquery("SELECT * FROM `{{player_options}}` WHERE `player_id` = {$this->user_id} FOR UPDATE");
208
-    while($row = db_fetch($query)) {
208
+    while ($row = db_fetch($query)) {
209 209
       // $this->data[$row['option_id']] = $row['value'];
210 210
       $this->data[$row['option_id']] = is_string($row['value']) && ($temp = unserialize($row['value'])) !== false ? $temp : $row['value']; // Десериализация
211 211
     }
Please login to merge, or discard this patch.
classes/Bonus/BonusListAtom.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@
 block discarded – undo
58 58
   protected function bonusSort(BonusAtom $a, BonusAtom $b) {
59 59
     static $bonusOrder = [BonusAtom::class, BonusAtomAbility::class, BonusAtomAdd::class, BonusAtomPercent::class, BonusAtomMultiply::class];
60 60
 
61
-    $indexA = (int)array_search(get_class($a), $bonusOrder);
62
-    $indexB = (int)array_search(get_class($b), $bonusOrder);
61
+    $indexA = (int) array_search(get_class($a), $bonusOrder);
62
+    $indexB = (int) array_search(get_class($b), $bonusOrder);
63 63
 
64 64
     return $indexA == $indexB ? 0 : ($indexA > $indexB ? +1 : -1);
65 65
   }
Please login to merge, or discard this patch.
includes/vars.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -564,9 +564,9 @@  discard block
 block discarded – undo
564 564
           2 => 0.01,
565 565
         ),
566 566
         P_MISSION_EXPEDITION_OUTCOME_SECONDARY => array(
567
-          90  => [P_MULTIPLIER => 0.01, P_MESSAGE_ID => 2,],
568
-          99  => [P_MULTIPLIER => 0.02, P_MESSAGE_ID => 1,],
569
-          100 => [P_MULTIPLIER => 0.10, P_MESSAGE_ID => 0,],
567
+          90  => [P_MULTIPLIER => 0.01, P_MESSAGE_ID => 2, ],
568
+          99  => [P_MULTIPLIER => 0.02, P_MESSAGE_ID => 1, ],
569
+          100 => [P_MULTIPLIER => 0.10, P_MESSAGE_ID => 0, ],
570 570
         ),
571 571
       ),
572 572
       FLT_EXPEDITION_OUTCOME_FOUND_RESOURCES => array(
@@ -578,9 +578,9 @@  discard block
 block discarded – undo
578 578
           2 => 0.025,
579 579
         ),
580 580
         P_MISSION_EXPEDITION_OUTCOME_SECONDARY => array(
581
-          90  => [P_MULTIPLIER => 0.025, P_MESSAGE_ID => 2,],
582
-          99  => [P_MULTIPLIER => 0.050, P_MESSAGE_ID => 1,],
583
-          100 => [P_MULTIPLIER => 0.100, P_MESSAGE_ID => 0,],
581
+          90  => [P_MULTIPLIER => 0.025, P_MESSAGE_ID => 2, ],
582
+          99  => [P_MULTIPLIER => 0.050, P_MESSAGE_ID => 1, ],
583
+          100 => [P_MULTIPLIER => 0.100, P_MESSAGE_ID => 0, ],
584 584
         ),
585 585
       ),
586 586
       FLT_EXPEDITION_OUTCOME_FOUND_DM        => array(
Please login to merge, or discard this patch.
includes/includes/flt_mission_explore.php 1 patch
Spacing   +37 added lines, -38 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
 
15 15
   $fleet_left = 1 - mt_rand(1, 3) * mt_rand(200000, 300000) / 1000000;
16 16
   $fleet_lost = array();
17
-  foreach($fleet as $unit_id => &$unit_amount) {
17
+  foreach ($fleet as $unit_id => &$unit_amount) {
18 18
     $ships_left = floor($unit_amount * $fleet_left);
19 19
     $fleet_lost[$unit_id] = $unit_amount - $ships_left;
20 20
     $unit_amount = $ships_left;
21
-    if(!$unit_amount) {
21
+    if (!$unit_amount) {
22 22
       unset($fleet[$unit_id]);
23 23
     }
24 24
   }
@@ -31,14 +31,14 @@  discard block
 block discarded – undo
31 31
 //  $fleet = array();
32 32
 }
33 33
 
34
-function flt_mission_explore_addon(&$result){return sn_function_call('flt_mission_explore_addon', array(&$result));}
34
+function flt_mission_explore_addon(&$result) {return sn_function_call('flt_mission_explore_addon', array(&$result)); }
35 35
 function sn_flt_mission_explore_addon(&$result) {
36 36
   return $result;
37 37
 }
38 38
 
39 39
 
40 40
 function flt_mission_explore(&$mission_data) {
41
-  if(!isset($mission_data['fleet_event']) || $mission_data['fleet_event'] != EVENT_FLT_ACOMPLISH) {
41
+  if (!isset($mission_data['fleet_event']) || $mission_data['fleet_event'] != EVENT_FLT_ACOMPLISH) {
42 42
     return CACHE_NONE;
43 43
   }
44 44
 
@@ -71,10 +71,10 @@  discard block
 block discarded – undo
71 71
   $outcome_list = &$result['$outcome_list'];
72 72
   $fleet_metal_points = &$result['$fleet_metal_points'];
73 73
 
74
-  if(!$ship_data) {
75
-    foreach(sn_get_groups('fleet') as $unit_id) {
74
+  if (!$ship_data) {
75
+    foreach (sn_get_groups('fleet') as $unit_id) {
76 76
       $unit_info = get_unit_param($unit_id);
77
-      if($unit_info[P_UNIT_TYPE] != UNIT_SHIPS || !isset($unit_info['engine'][0]['speed']) || !$unit_info['engine'][0]['speed']) {
77
+      if ($unit_info[P_UNIT_TYPE] != UNIT_SHIPS || !isset($unit_info['engine'][0]['speed']) || !$unit_info['engine'][0]['speed']) {
78 78
         continue;
79 79
       }
80 80
       $ship_data[$unit_id][P_COST_METAL] = get_unit_cost_in($unit_info[P_COST]);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
   $fleet = sys_unit_str2arr($fleet_row['fleet_array']);
87 87
   $fleet_capacity = 0;
88 88
   $fleet_metal_points = 0;
89
-  foreach($fleet as $ship_id => $ship_amount) {
89
+  foreach ($fleet as $ship_id => $ship_amount) {
90 90
     $unit_info = get_unit_param($ship_id);
91 91
     $fleet_capacity += $ship_amount * $unit_info[P_CAPACITY];
92 92
     $fleet_metal_points += $ship_amount * $ship_data[$ship_id][P_COST_METAL];
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
   $flt_stay_hours = ($fleet_row['fleet_end_stay'] - $fleet_row['fleet_start_time']) / 3600 * ($config->game_speed_expedition ? $config->game_speed_expedition : 1);
97 97
 
98 98
   $outcome_list = sn_get_groups(GROUP_MISSION_EXPLORE_OUTCOMES);
99
-  $outcome_list[FLT_EXPEDITION_OUTCOME_NONE]['chance'] = ceil(200 / pow($flt_stay_hours, 1/1.7));
99
+  $outcome_list[FLT_EXPEDITION_OUTCOME_NONE]['chance'] = ceil(200 / pow($flt_stay_hours, 1 / 1.7));
100 100
 
101 101
   $chance_max = 0;
102
-  foreach($outcome_list as $key => &$value) {
103
-    if(!$value['chance']) {
102
+  foreach ($outcome_list as $key => &$value) {
103
+    if (!$value['chance']) {
104 104
       unset($outcome_list[$key]);
105 105
       continue;
106 106
     }
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
   $outcome_value = mt_rand(0, $chance_max);
110 110
 // $outcome_value = 409;
111 111
   $outcome_description = &$outcome_list[$mission_outcome = FLT_EXPEDITION_OUTCOME_NONE];
112
-  foreach($outcome_list as $key => &$value) {
113
-    if(!$value['chance']) {
112
+  foreach ($outcome_list as $key => &$value) {
113
+    if (!$value['chance']) {
114 114
       continue;
115 115
     }
116 116
     $mission_outcome = $key;
117 117
     $outcome_description = $value;
118
-    if($outcome_value <= $outcome_description['value']) {
118
+    if ($outcome_value <= $outcome_description['value']) {
119 119
       break;
120 120
     }
121 121
   }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
   $found_dark_matter = 0;
132 132
 //  $outcome_mission_sub = -1;
133 133
 
134
-  switch($mission_outcome) {
134
+  switch ($mission_outcome) {
135 135
 //  switch(FLT_EXPEDITION_OUTCOME_LOST_FLEET) { // TODO DEBUG!
136 136
     case FLT_EXPEDITION_OUTCOME_LOST_FLEET:
137 137
       flt_mission_explore_outcome_lost_fleet($result);
@@ -166,14 +166,14 @@  discard block
 block discarded – undo
166 166
 
167 167
       // Рассчитываем стоимость самого дорого корабля в металле
168 168
       $max_metal_cost = 0;
169
-      foreach($fleet as $ship_id => $ship_amount) {
169
+      foreach ($fleet as $ship_id => $ship_amount) {
170 170
         $max_metal_cost = max($max_metal_cost, $ship_data[$ship_id]['metal_cost']);
171 171
       }
172 172
 
173 173
       // Ограничиваем корабли только теми, чья стоимость в металле меньше или равно стоимости самого дорогого корабля
174 174
       $can_be_found = array();
175
-      foreach($ship_data as $ship_id => $ship_info) {
176
-        if($ship_info['metal_cost'] < $max_metal_cost) {
175
+      foreach ($ship_data as $ship_id => $ship_info) {
176
+        if ($ship_info['metal_cost'] < $max_metal_cost) {
177 177
           $can_be_found[$ship_id] = $ship_info['metal_cost'];
178 178
         }
179 179
       }
@@ -182,13 +182,13 @@  discard block
 block discarded – undo
182 182
       unset($can_be_found[SHIP_SPY]);
183 183
 
184 184
       $fleet_found = array();
185
-      while(count($can_be_found) && $found_in_metal >= max($can_be_found)) {
185
+      while (count($can_be_found) && $found_in_metal >= max($can_be_found)) {
186 186
         $found_index = mt_rand(1, count($can_be_found)) - 1;
187 187
         $found_ship = array_slice($can_be_found, $found_index, 1, true);
188 188
         $found_ship_cost = reset($found_ship);
189 189
         $found_ship_id = key($found_ship);
190 190
 
191
-        if($found_ship_cost > $found_in_metal) {
191
+        if ($found_ship_cost > $found_in_metal) {
192 192
           unset($can_be_found[$found_ship_id]);
193 193
         } else {
194 194
           $found_ship_count = mt_rand(1, floor($found_in_metal / $found_ship_cost));
@@ -197,10 +197,10 @@  discard block
 block discarded – undo
197 197
         }
198 198
       }
199 199
 
200
-      if(empty($fleet_found)) {
200
+      if (empty($fleet_found)) {
201 201
         $msg_text_addon = $lang['flt_mission_expedition']['outcomes'][$mission_outcome]['no_result'];
202 202
       } else {
203
-        foreach($fleet_found as $unit_id => $unit_amount) {
203
+        foreach ($fleet_found as $unit_id => $unit_amount) {
204 204
           $fleet[$unit_id] += $unit_amount;
205 205
         }
206 206
       }
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
       $fleet_row['fleet_resource_crystal'] += $resources_found[RES_CRYSTAL];
227 227
       $fleet_row['fleet_resource_deuterium'] += $resources_found[RES_DEUTERIUM];
228 228
 
229
-      if(array_sum($resources_found) == 0) {
229
+      if (array_sum($resources_found) == 0) {
230 230
         $msg_text_addon = $lang['flt_mission_expedition']['outcomes'][$mission_outcome]['no_result'];
231 231
       }
232 232
     break;
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
       // Рассчитываем количество найденной ТМ
238 238
       $found_dark_matter = floor(min($outcome_percent * $fleet_metal_points / $rates[RES_DARK_MATTER], 10000) * mt_rand(750000, 1000000) / 1000000);
239 239
 
240
-      if(!$found_dark_matter) {
240
+      if (!$found_dark_matter) {
241 241
         $msg_text_addon = $lang['flt_mission_expedition']['outcomes'][$mission_outcome]['no_result'];
242 242
       }
243 243
     break;
@@ -251,31 +251,31 @@  discard block
 block discarded – undo
251 251
 
252 252
   flt_mission_explore_addon($result);
253 253
 
254
-  if($found_dark_matter) {
254
+  if ($found_dark_matter) {
255 255
     rpg_points_change($fleet_row['fleet_owner'], RPG_EXPEDITION, $found_dark_matter, 'Expedition Bonus');
256 256
     $msg_text_addon = sprintf($lang['flt_mission_expedition']['found_dark_matter'], $found_dark_matter);
257 257
   }
258 258
 
259
-  if(!empty($fleet_lost)) {
259
+  if (!empty($fleet_lost)) {
260 260
     $msg_text_addon = $lang['flt_mission_expedition']['lost_fleet'];
261
-    foreach($fleet_lost as $ship_id => $ship_amount) {
261
+    foreach ($fleet_lost as $ship_id => $ship_amount) {
262 262
       $msg_text_addon .= $lang['tech'][$ship_id] . ' - ' . $ship_amount . "\r\n";
263 263
     }
264 264
   }
265 265
 
266 266
   $fleet_row['fleet_amount'] = array_sum($fleet);
267
-  if(!empty($fleet) && $fleet_row['fleet_amount']) {
268
-    if(!empty($fleet_found)) {
267
+  if (!empty($fleet) && $fleet_row['fleet_amount']) {
268
+    if (!empty($fleet_found)) {
269 269
       $msg_text_addon = $lang['flt_mission_expedition']['found_fleet'];
270
-      foreach($fleet_found as $ship_id => $ship_amount) {
270
+      foreach ($fleet_found as $ship_id => $ship_amount) {
271 271
         $msg_text_addon .= $lang['tech'][$ship_id] . ' - ' . $ship_amount . "\r\n";
272 272
       }
273 273
     }
274 274
 
275 275
     $query_delta = array();
276
-    if(!empty($resources_found) && array_sum($resources_found) > 0) {
276
+    if (!empty($resources_found) && array_sum($resources_found) > 0) {
277 277
       $msg_text_addon = $lang['flt_mission_expedition']['found_resources'];
278
-      foreach($resources_found as $ship_id => $ship_amount) {
278
+      foreach ($resources_found as $ship_id => $ship_amount) {
279 279
         $msg_text_addon .= $lang['tech'][$ship_id] . ' - ' . $ship_amount . "\r\n";
280 280
       }
281 281
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
     }
289 289
 
290 290
     $query_data = array();
291
-    if(!empty($fleet_lost) || !empty($fleet_found)) {
291
+    if (!empty($fleet_lost) || !empty($fleet_found)) {
292 292
       $fleet_row['fleet_array'] = sys_unit_arr2str($fleet);
293 293
 
294 294
 //      $query_data[] = "`fleet_amount` = {$fleet_row['fleet_amount']}";
@@ -316,17 +316,16 @@  discard block
 block discarded – undo
316 316
 
317 317
   db_user_set_by_id($fleet_row['fleet_owner'], "`player_rpg_explore_xp` = `player_rpg_explore_xp` + 1");
318 318
 
319
-  if(!$msg_text) {
319
+  if (!$msg_text) {
320 320
     $messages = &$lang['flt_mission_expedition']['outcomes'][$mission_outcome]['messages'];
321
-    if($outcome_mission_sub >= 0 && is_array($messages)) {
321
+    if ($outcome_mission_sub >= 0 && is_array($messages)) {
322 322
       $messages = &$messages[$outcome_mission_sub];
323 323
     }
324 324
 
325
-    $msg_text = is_string($messages) ? $messages :
326
-      (is_array($messages) ? $messages[mt_rand(0, count($messages) - 1)] : '');
325
+    $msg_text = is_string($messages) ? $messages : (is_array($messages) ? $messages[mt_rand(0, count($messages) - 1)] : '');
327 326
   }
328 327
   $msg_text = sprintf($msg_text, $fleet_row['fleet_id'], uni_render_coordinates($fleet_row, 'fleet_end_')) .
329
-    ($msg_text_addon ? "\r\n" . $msg_text_addon: '');
328
+    ($msg_text_addon ? "\r\n" . $msg_text_addon : '');
330 329
 
331 330
   msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_end_stay'], MSG_TYPE_EXPLORE, $msg_sender, $msg_title, $msg_text);
332 331
 
Please login to merge, or discard this patch.
includes/template.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -283,8 +283,8 @@  discard block
 block discarded – undo
283 283
     displayP($page_item);
284 284
   }
285 285
 
286
-  if(is_array($template_result[TEMPLATE_EXTRA_ARRAY]) && !empty($template_result[TEMPLATE_EXTRA_ARRAY])) {
287
-    foreach($template_result[TEMPLATE_EXTRA_ARRAY] as $extraName => $extraTemplate) {
286
+  if (is_array($template_result[TEMPLATE_EXTRA_ARRAY]) && !empty($template_result[TEMPLATE_EXTRA_ARRAY])) {
287
+    foreach ($template_result[TEMPLATE_EXTRA_ARRAY] as $extraName => $extraTemplate) {
288 288
       /**
289 289
        * @var template $extraTemplate
290 290
        */
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
     renderFooter();
298 298
   }
299 299
 
300
-  $user['authlevel'] >= 3 && $config->debug ? $debug->echo_log() : false;;
300
+  $user['authlevel'] >= 3 && $config->debug ? $debug->echo_log() : false; ;
301 301
 
302 302
   sn_db_disconnect();
303 303
 
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
     'QUE_ID'   => QUE_RESEARCH,
680 680
     'QUE_HTML' => 'topnav',
681 681
 
682
-    'RESEARCH_ONGOING' => (boolean)$user['que'],
682
+    'RESEARCH_ONGOING' => (boolean) $user['que'],
683 683
 
684 684
     'TIME_TEXT'       => sprintf($str_date_format, $time_now_parsed['year'], $lang['months'][$time_now_parsed['mon']], $time_now_parsed['mday'],
685 685
       $time_now_parsed['hours'], $time_now_parsed['minutes'], $time_now_parsed['seconds']
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
     'LANG'     => $language ? $language : '',
973 973
     'referral' => $id_ref ? '&id_ref=' . $id_ref : '',
974 974
 
975
-    'REQUEST_PARAMS' => !empty($url_params) ? '?' . implode('&', $url_params) : '',// "?lang={$language}" . ($id_ref ? "&id_ref={$id_ref}" : ''),
975
+    'REQUEST_PARAMS' => !empty($url_params) ? '?' . implode('&', $url_params) : '', // "?lang={$language}" . ($id_ref ? "&id_ref={$id_ref}" : ''),
976 976
     'FILENAME'       => basename($_SERVER['PHP_SELF']),
977 977
   ));
978 978
 
Please login to merge, or discard this patch.
includes/general/formatters.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -112,10 +112,10 @@  discard block
 block discarded – undo
112 112
     $rexep = "#" . strtr(preg_quote($format), $masks) . "#";
113 113
     if (preg_match($rexep, $date, $out)) {
114 114
       $ret = array(
115
-        "tm_sec"  => (int)$out['S'],
116
-        "tm_min"  => (int)$out['M'],
117
-        "tm_hour" => (int)$out['H'],
118
-        "tm_mday" => (int)$out['d'],
115
+        "tm_sec"  => (int) $out['S'],
116
+        "tm_min"  => (int) $out['M'],
117
+        "tm_hour" => (int) $out['H'],
118
+        "tm_mday" => (int) $out['d'],
119 119
         "tm_mon"  => $out['m'] ? $out['m'] - 1 : 0,
120 120
         "tm_year" => $out['Y'] > 1900 ? $out['Y'] - 1900 : 0,
121 121
       );
@@ -150,5 +150,5 @@  discard block
 block discarded – undo
150 150
  * @return int
151 151
  */
152 152
 function datePart($fullDate) {
153
-  return (int)strtotime(date('Y-m-d', $fullDate));
153
+  return (int) strtotime(date('Y-m-d', $fullDate));
154 154
 }
Please login to merge, or discard this patch.