Test Failed
Push — trunk ( e02d87...314b8c )
by SuperNova.WS
07:20
created
classes/classCache.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 
151 151
   public function unset_by_prefix($prefix_unset = '') {
152 152
     static $array_clear;
153
-    !$array_clear ? $array_clear = function (&$v, $k, $p) {
153
+    !$array_clear ? $array_clear = function(&$v, $k, $p) {
154 154
       strpos($k, $p) === 0 ? $v = null : false;
155 155
     } : false;
156 156
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
     if ($this->$name[0] === null) {
206 206
       for ($i = count($name) - 1; $i > 0; $i--) {
207 207
         $cName = "{$name[$i]}_COUNT";
208
-        $cName1 = "{$name[$i-1]}_COUNT";
208
+        $cName1 = "{$name[$i - 1]}_COUNT";
209 209
         if ($this->$cName1 == null || $i == 1) {
210 210
           $this->$cName++;
211 211
         }
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
     $count = count($name);
252 252
     for ($i = 1; $i < $count; $i++) {
253 253
       $cName = "{$name[$i]}_COUNT";
254
-      $cName1 = "{$name[$i-1]}_COUNT";
254
+      $cName1 = "{$name[$i - 1]}_COUNT";
255 255
 
256 256
       if ($i == 1 || $this->$cName1 === null) {
257 257
         $this->$cName--;
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`        = '" . 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] = db_insert_id();
141 141
 
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
       $player_id,
147 147
 
148 148
       "'" . 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
       "'" . 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.
resources.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,7 @@
 block discarded – undo
30 30
  * @param $resource_id
31 31
  * @param ResourceCalculations $capsObj
32 32
  */
33
-function int_calc_storage_bar($resource_id, $capsObj)
34
-{
33
+function int_calc_storage_bar($resource_id, $capsObj) {
35 34
   global $lang, $template, $planetrow, $user;
36 35
 
37 36
   $totalProduction      = $capsObj->getProduction($resource_id);
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
 // $BuildEnergyTech             = $user['energy_tech'];
113 113
 for ($Option = 10; $Option >= 0; $Option--)
114 114
 {
115
- $template->assign_block_vars('option', array(
116
-   'VALUE' => $Option * 10,
117
- ));
115
+  $template->assign_block_vars('option', array(
116
+    'VALUE' => $Option * 10,
117
+  ));
118 118
 }
119 119
 
120 120
 $capsObj = new ResourceCalculations();
@@ -180,12 +180,12 @@  discard block
 block discarded – undo
180 180
 int_calc_storage_bar(RES_DEUTERIUM, $capsObj);
181 181
 
182 182
 $template->assign_vars(array(
183
- 'PLANET_NAME'          => $planetrow['name'],
184
- 'PLANET_TYPE'          => $planetrow['planet_type'],
183
+  'PLANET_NAME'          => $planetrow['name'],
184
+  'PLANET_TYPE'          => $planetrow['planet_type'],
185 185
 
186
- 'PRODUCTION_LEVEL'     => floor($capsObj->efficiency * 100),
186
+  'PRODUCTION_LEVEL'     => floor($capsObj->efficiency * 100),
187 187
 
188
- 'PAGE_HINT'            => $lang['res_hint'],
188
+  'PAGE_HINT'            => $lang['res_hint'],
189 189
 ));
190 190
 
191 191
 SnTemplate::display($template, $lang['res_planet_production']);
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
   ]);
53 53
 };
54 54
 
55
-$ValidList['percent'] = array (  0,  10,  20,  30,  40,  50,  60,  70,  80,  90, 100 );
55
+$ValidList['percent'] = array(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100);
56 56
 $template = SnTemplate::gettemplate('resources', true);
57 57
 
58 58
 /** @noinspection PhpUnhandledExceptionInspection */
59 59
 $planet = SN::$gc->repoV2->getPlanet($planetrow['id']);
60
-if(!empty($transmutation_result = $planet->sn_sys_planet_core_transmute($user))) {
60
+if (!empty($transmutation_result = $planet->sn_sys_planet_core_transmute($user))) {
61 61
   $template->assign_block_vars('result', $transmutation_result);
62 62
   $planet->dbLoadRecord($planetrow['id']);
63 63
 }
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
   'ENERGY_TYPE'    => $capsObj->productionCurrentMatrix[RES_ENERGY][0],
130 130
 ));
131 131
 
132
-foreach($sn_group_factories as $unit_id)
132
+foreach ($sn_group_factories as $unit_id)
133 133
 {
134
-  if(mrc_get_level($user, $planetrow, $unit_id) > 0 && get_unit_param($unit_id))
134
+  if (mrc_get_level($user, $planetrow, $unit_id) > 0 && get_unit_param($unit_id))
135 135
   {
136 136
     $level_plain = mrc_get_level($user, $planetrow, $unit_id, false, true);
137 137
     $template->assign_block_vars('production', array(
Please login to merge, or discard this patch.
classes/Fleet/MissionEspionage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 
31 31
       $this->target_message = "{$lang['sys_mess_spy_enemy_fleet']} {$this->src_planet['name']} " . uni_render_coordinates_href($this->src_planet, '', 3);
32 32
       $this->target_message .= " {$lang['sys_mess_spy_seen_at']} {$this->dst_planet['name']} " . uni_render_coordinates($this->dst_planet);
33
-      if($this->missionReport->isSpyDetected()) {
33
+      if ($this->missionReport->isSpyDetected()) {
34 34
         $this->target_message .= "<br />{$lang['sys_mess_spy_destroyed_enemy']}";
35 35
       }
36 36
 
Please login to merge, or discard this patch.
classes/Pm/DecodeEspionage.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
       $groups[get_unit_param($unitId, P_UNIT_TYPE)][$unitId] = $unitAmount;
26 26
     }
27 27
 
28
-    foreach(static::ALLOWED_UNITS as $groupId) {
29
-      if(empty($groups[$groupId])) {
28
+    foreach (static::ALLOWED_UNITS as $groupId) {
29
+      if (empty($groups[$groupId])) {
30 30
         continue;
31 31
       }
32 32
 
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
         'NAME' => $lang['tech'][$groupId],
36 36
       ]);
37 37
 
38
-      foreach($general->getGroupsById($groupId) as $unitId) {
39
-        if((!isset($groups[$groupId][$unitId]) || floor($groups[$groupId][$unitId]) < 1) && $unitId != RES_ENERGY) {
38
+      foreach ($general->getGroupsById($groupId) as $unitId) {
39
+        if ((!isset($groups[$groupId][$unitId]) || floor($groups[$groupId][$unitId]) < 1) && $unitId != RES_ENERGY) {
40 40
           continue;
41 41
         }
42 42
 
Please login to merge, or discard this patch.
includes/functions/msg_send_simple_message.php 2 patches
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'];
@@ -49,8 +48,7 @@  discard block
 block discarded – undo
49 48
  * @param bool $force
50 49
  * @param bool $json
51 50
  */
52
-function msg_send_simple_message($owners, $sender, $timestamp, $message_type, $from, $subject, $text, $escaped = STRING_NEED_ESCAPING, $force = false, $json = false)
53
-{
51
+function msg_send_simple_message($owners, $sender, $timestamp, $message_type, $from, $subject, $text, $escaped = STRING_NEED_ESCAPING, $force = false, $json = false) {
54 52
   global $config, $user, $sn_message_class_list;
55 53
 
56 54
   if(!$owners)
@@ -91,8 +89,7 @@  discard block
 block discarded – undo
91 89
     // TODO Добавить $sender - рассылка может быть и от кого-то
92 90
     db_message_insert_all($message_type, $from, $subject, $text);
93 91
     $owners = [];
94
-  }
95
-  else
92
+  } else
96 93
   {
97 94
     $insert_values = [];
98 95
     $insert_template = "('%u'," . str_replace('%', '%%', " '{$sender}', '{$timestamp}', '{$message_type}', '{$from}', '{$subject}', '{$text}', '" . intval($json) . "')");
@@ -102,8 +99,7 @@  discard block
 block discarded – undo
102 99
       if($user['id'] != $owner)
103 100
       {
104 101
         $owner_row = db_user_by_id($owner);
105
-      }
106
-      else
102
+      } else
107 103
       {
108 104
         $owner_row = $user;
109 105
       }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     "ally_id = '{$ally_id}'" . ($ally_rank_id >= 0 ? " AND ally_rank_id = {$ally_rank_id}" : ''),
27 27
     false, 'id, username');
28 28
   // while ($u = db_fetch($query))
29
-  foreach($query as $u)
29
+  foreach ($query as $u)
30 30
   {
31 31
     $sendList[] = $u['id'];
32 32
     $list .= "<br>{$u['username']} ";
@@ -53,19 +53,19 @@  discard block
 block discarded – undo
53 53
 {
54 54
   global $config, $user, $sn_message_class_list;
55 55
 
56
-  if(!$owners)
56
+  if (!$owners)
57 57
   {
58 58
     return;
59 59
   }
60 60
 
61 61
   $timestamp = $timestamp ? $timestamp : SN_TIME_NOW;
62 62
   $sender = intval($sender);
63
-  if(!is_array($owners))
63
+  if (!is_array($owners))
64 64
   {
65 65
     $owners = array($owners);
66 66
   }
67 67
 
68
-  if($escaped == STRING_NEED_ESCAPING)
68
+  if ($escaped == STRING_NEED_ESCAPING)
69 69
   {
70 70
     $from = db_escape($from);
71 71
     $subject = db_escape($subject);
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
 
82 82
   $message_class_name_total = $sn_message_class_list[MSG_TYPE_NEW]['name'];
83 83
 
84
-  if($owners[0] == '*')
84
+  if ($owners[0] == '*')
85 85
   {
86
-    if($user['authlevel'] < 3)
86
+    if ($user['authlevel'] < 3)
87 87
     {
88 88
       return false;
89 89
     }
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
     foreach ($owners as $owner)
101 101
     {
102
-      if($user['id'] != $owner)
102
+      if ($user['id'] != $owner)
103 103
       {
104 104
         $owner_row = db_user_by_id($owner);
105 105
       }
@@ -109,14 +109,14 @@  discard block
 block discarded – undo
109 109
       }
110 110
       sys_user_options_unpack($owner_row);
111 111
 
112
-      if($force || !$message_class_switchable || $owner_row["opt_{$message_class_name}"])
112
+      if ($force || !$message_class_switchable || $owner_row["opt_{$message_class_name}"])
113 113
       {
114 114
         $insert_values[] = sprintf($insert_template, $owner);
115 115
       }
116 116
 
117
-      if($message_class_email && $config->game_email_pm && $owner_row["opt_email_{$message_class_name}"])
117
+      if ($message_class_email && $config->game_email_pm && $owner_row["opt_email_{$message_class_name}"])
118 118
       {
119
-        if($message_type == MSG_TYPE_SPY) {
119
+        if ($message_type == MSG_TYPE_SPY) {
120 120
           @$result = mymail($owner_row['email'], $subject, SN::$lang['sys_spy_activity'], '', true);
121 121
         } else {
122 122
           @$result = mymail($owner_row['email'], $subject, $text_unescaped, '', true);
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
       }
125 125
     }
126 126
 
127
-    if(empty($insert_values))
127
+    if (empty($insert_values))
128 128
     {
129 129
       return;
130 130
     }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
   }
135 135
   db_user_list_set_mass_mail($owners, "`{$message_class_name}` = `{$message_class_name}` + 1, `{$message_class_name_total}` = `{$message_class_name_total}` + 1");
136 136
 
137
-  if(in_array($user['id'], $owners) || $owners[0] == '*')
137
+  if (in_array($user['id'], $owners) || $owners[0] == '*')
138 138
   {
139 139
     $user[$message_class_name]++;
140 140
     $user[$message_class_name_total]++;
Please login to merge, or discard this patch.
includes/vars_combats.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -223,7 +223,7 @@
 block discarded – undo
223 223
       'factor'      => 1,
224 224
     ),
225 225
     P_UNIT_PRODUCTION   => array(
226
-      RES_ENERGY => function ($level, $production_factor, $user, $planet_row) { return ($planet_row["temp_max"] / 4 + 20) * $level * (0.1 * $production_factor); },
226
+      RES_ENERGY => function($level, $production_factor, $user, $planet_row) { return ($planet_row["temp_max"] / 4 + 20) * $level * (0.1 * $production_factor); },
227 227
     ),
228 228
     P_MINING_IS_MANAGED => true,
229 229
 
Please login to merge, or discard this patch.
includes/vars_structures.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
       'factor'      => 1.5,
17 17
     ),
18 18
     P_UNIT_PRODUCTION   => array(
19
-      RES_METAL  => function ($level, $production_factor, $user, $planet_row) { return 40 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
20
-      RES_ENERGY => function ($level, $production_factor, $user, $planet_row) { return -13 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
19
+      RES_METAL  => function($level, $production_factor, $user, $planet_row) { return 40 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
20
+      RES_ENERGY => function($level, $production_factor, $user, $planet_row) { return -13 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
21 21
     ),
22 22
     P_MINING_IS_MANAGED => true,
23 23
   ),
@@ -34,8 +34,8 @@  discard block
 block discarded – undo
34 34
       'factor'      => 1.6,
35 35
     ),
36 36
     P_UNIT_PRODUCTION   => array(
37
-      RES_CRYSTAL => function ($level, $production_factor, $user, $planet_row) { return 32 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
38
-      RES_ENERGY  => function ($level, $production_factor, $user, $planet_row) { return -16 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
37
+      RES_CRYSTAL => function($level, $production_factor, $user, $planet_row) { return 32 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
38
+      RES_ENERGY  => function($level, $production_factor, $user, $planet_row) { return -16 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
39 39
     ),
40 40
     P_MINING_IS_MANAGED => true,
41 41
   ),
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
       'factor'      => 1.5,
53 53
     ),
54 54
     P_UNIT_PRODUCTION   => array(
55
-      RES_DEUTERIUM => function ($level, $production_factor, $user, $planet_row) { return 10 * $level * pow(1.1, $level) * (0.1 * $production_factor) * (-0.002 * $planet_row["temp_max"] + 1.28); },
56
-      RES_ENERGY    => function ($level, $production_factor, $user, $planet_row) { return -20 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
55
+      RES_DEUTERIUM => function($level, $production_factor, $user, $planet_row) { return 10 * $level * pow(1.1, $level) * (0.1 * $production_factor) * (-0.002 * $planet_row["temp_max"] + 1.28); },
56
+      RES_ENERGY    => function($level, $production_factor, $user, $planet_row) { return -20 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
57 57
     ),
58 58
     P_MINING_IS_MANAGED => true,
59 59
   ),
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
       'factor'      => 1.5,
71 71
     ),
72 72
     P_UNIT_PRODUCTION   => array(
73
-      RES_ENERGY => function ($level, $production_factor, $user, $planet_row) { return ($planet_row["temp_max"] / 5 + 15) * $level * pow(1.1, $level) * (0.1 * $production_factor); },
73
+      RES_ENERGY => function($level, $production_factor, $user, $planet_row) { return ($planet_row["temp_max"] / 5 + 15) * $level * pow(1.1, $level) * (0.1 * $production_factor); },
74 74
     ),
75 75
     P_MINING_IS_MANAGED => true,
76 76
   ),
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
       'factor'      => 1.8,
89 89
     ),
90 90
     P_UNIT_PRODUCTION   => array(
91
-      RES_DEUTERIUM => function ($level, $production_factor, $user, $planet_row) { return -10 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
92
-      RES_ENERGY    => function ($level, $production_factor, $user, $planet_row) { return 30 * $level * pow(1.05 + 0.01 * mrc_get_level($user, "", TECH_ENERGY), $level) * (0.1 * $production_factor); },
91
+      RES_DEUTERIUM => function($level, $production_factor, $user, $planet_row) { return -10 * $level * pow(1.1, $level) * (0.1 * $production_factor); },
92
+      RES_ENERGY    => function($level, $production_factor, $user, $planet_row) { return 30 * $level * pow(1.05 + 0.01 * mrc_get_level($user, "", TECH_ENERGY), $level) * (0.1 * $production_factor); },
93 93
     ),
94 94
     P_MINING_IS_MANAGED => true,
95 95
   ),
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
       'factor'      => 2,
107 107
     ),
108 108
     'storage'  => array(
109
-      RES_METAL => function ($level) { return BASE_STORAGE_SIZE * pow(1.5, $level); },
109
+      RES_METAL => function($level) { return BASE_STORAGE_SIZE * pow(1.5, $level); },
110 110
     ),
111 111
   ),
112 112
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
       'factor'      => 2,
123 123
     ),
124 124
     'storage'  => array(
125
-      RES_CRYSTAL => function ($level) { return BASE_STORAGE_SIZE * pow(1.5, $level); },
125
+      RES_CRYSTAL => function($level) { return BASE_STORAGE_SIZE * pow(1.5, $level); },
126 126
     ),
127 127
   ),
128 128
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
       'factor'      => 2,
139 139
     ),
140 140
     'storage'  => array(
141
-      RES_DEUTERIUM => function ($level) { return BASE_STORAGE_SIZE * pow(1.5, $level); },
141
+      RES_DEUTERIUM => function($level) { return BASE_STORAGE_SIZE * pow(1.5, $level); },
142 142
     ),
143 143
   ),
144 144
 
Please login to merge, or discard this patch.
classes/_SnCacheInternal.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
     //print("<br />CACHE CLEAR {$cache_id} " . ($hard ? 'HARD' : 'SOFT') . "<br />");
53 53
     if ($hard && !empty(_SnCacheInternal::$data[$location_type])) {
54 54
       // Здесь нельзя делать unset - надо записывать NULL, что бы это отразилось на зависимых записях
55
-      array_walk(_SnCacheInternal::$data[$location_type], function (&$item) { $item = null; });
55
+      array_walk(_SnCacheInternal::$data[$location_type], function(&$item) { $item = null; });
56 56
     }
57 57
     _SnCacheInternal::$locator[$location_type] = [];
58 58
     _SnCacheInternal::$queries[$location_type] = [];
Please login to merge, or discard this patch.