Passed
Push — trunk ( 338765...433e05 )
by SuperNova.WS
04:23
created
classes/Alliance/AllianceMember.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
    * @return bool
47 47
    */
48 48
   public function changeTitle(AllianceTitle $title) {
49
-    if(!$title instanceof AllianceTitle) {
49
+    if (!$title instanceof AllianceTitle) {
50 50
       return false;
51 51
     }
52 52
 
Please login to merge, or discard this patch.
classes/Alliance/AllianceTitleList.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         continue;
46 46
       }
47 47
 
48
-      $result[] = (string)$title;
48
+      $result[] = (string) $title;
49 49
     }
50 50
 
51 51
     return implode(';', $result);
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
    * Updates title names and access rights with current ones
68 68
    */
69 69
   public function updateTitles() {
70
-    $this->alliance->titleList = (string)$this;
70
+    $this->alliance->titleList = (string) $this;
71 71
   }
72 72
 
73 73
   protected function extractTitles() {
Please login to merge, or discard this patch.
classes/Bonus/BonusAtom.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@
 block discarded – undo
58 58
    * @return int
59 59
    */
60 60
   public static function calcBonusPower($unitInfo) {
61
-    return isset($unitInfo[P_BONUS_VALUE]) ? $unitInfo[P_BONUS_VALUE] :
62
-      (static::calcBonusType($unitInfo) == BONUS_ABILITY ? 1 : 0);
61
+    return isset($unitInfo[P_BONUS_VALUE]) ? $unitInfo[P_BONUS_VALUE] : (static::calcBonusType($unitInfo) == BONUS_ABILITY ? 1 : 0);
63 62
   }
64 63
 
65 64
   /**
Please login to merge, or discard this patch.
includes/template.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
     renderFooter();
289 289
   }
290 290
 
291
-  $user['authlevel'] >= 3 && $config->debug ? $debug->echo_log() : false;;
291
+  $user['authlevel'] >= 3 && $config->debug ? $debug->echo_log() : false; ;
292 292
 
293 293
   sn_db_disconnect();
294 294
 
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
     'QUE_ID'   => QUE_RESEARCH,
671 671
     'QUE_HTML' => 'topnav',
672 672
 
673
-    'RESEARCH_ONGOING' => (boolean)$user['que'],
673
+    'RESEARCH_ONGOING' => (boolean) $user['que'],
674 674
 
675 675
     'TIME_TEXT'       => sprintf($str_date_format, $time_now_parsed['year'], $lang['months'][$time_now_parsed['mon']], $time_now_parsed['mday'],
676 676
       $time_now_parsed['hours'], $time_now_parsed['minutes'], $time_now_parsed['seconds']
@@ -963,7 +963,7 @@  discard block
 block discarded – undo
963 963
     'LANG'     => $language ? $language : '',
964 964
     'referral' => $id_ref ? '&id_ref=' . $id_ref : '',
965 965
 
966
-    'REQUEST_PARAMS' => !empty($url_params) ? '?' . implode('&', $url_params) : '',// "?lang={$language}" . ($id_ref ? "&id_ref={$id_ref}" : ''),
966
+    'REQUEST_PARAMS' => !empty($url_params) ? '?' . implode('&', $url_params) : '', // "?lang={$language}" . ($id_ref ? "&id_ref={$id_ref}" : ''),
967 967
     'FILENAME'       => basename($_SERVER['PHP_SELF']),
968 968
   ));
969 969
 
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.
classes/Bonus/ValueStorage.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -48,20 +48,20 @@  discard block
 block discarded – undo
48 48
   }
49 49
 
50 50
   protected function initValues() {
51
-    $this[UNIT_SERVER_SPEED_BUILDING] = function (ValueStorage $vs) {
51
+    $this[UNIT_SERVER_SPEED_BUILDING] = function(ValueStorage $vs) {
52 52
       return new ValueBonused(UNIT_SERVER_SPEED_BUILDING, floatval($vs->getGlobalContainer()->config->game_speed));
53 53
     };
54
-    $this[UNIT_SERVER_SPEED_MINING] = function (ValueStorage $vs) {
54
+    $this[UNIT_SERVER_SPEED_MINING] = function(ValueStorage $vs) {
55 55
       return new ValueBonused(UNIT_SERVER_SPEED_MINING, floatval($vs->getGlobalContainer()->config->resource_multiplier));
56 56
     };
57
-    $this[UNIT_SERVER_SPEED_FLEET] = function (ValueStorage $vs) {
57
+    $this[UNIT_SERVER_SPEED_FLEET] = function(ValueStorage $vs) {
58 58
       return new ValueBonused(UNIT_SERVER_SPEED_FLEET, floatval($vs->getGlobalContainer()->config->fleet_speed));
59 59
     };
60
-    $this[UNIT_SERVER_SPEED_EXPEDITION] = function (ValueStorage $vs) {
60
+    $this[UNIT_SERVER_SPEED_EXPEDITION] = function(ValueStorage $vs) {
61 61
       return new ValueBonused(UNIT_SERVER_SPEED_EXPEDITION, floatval(1));
62 62
     };
63 63
 
64
-    $this[UNIT_SERVER_FLEET_NOOB_POINTS] = function (ValueStorage $vs) {
64
+    $this[UNIT_SERVER_FLEET_NOOB_POINTS] = function(ValueStorage $vs) {
65 65
       $config = $vs->getGlobalContainer()->config;
66 66
 
67 67
       return new ValueBonused(
@@ -69,11 +69,11 @@  discard block
 block discarded – undo
69 69
         floatval($config->game_noob_points * $vs->getBase(UNIT_SERVER_SPEED_MINING))
70 70
       );
71 71
     };
72
-    $this[UNIT_SERVER_FLEET_NOOB_FACTOR] = function (ValueStorage $vs) {
72
+    $this[UNIT_SERVER_FLEET_NOOB_FACTOR] = function(ValueStorage $vs) {
73 73
       return new ValueBonused(UNIT_SERVER_FLEET_NOOB_FACTOR, floatval($vs->getGlobalContainer()->config->game_noob_factor));
74 74
     };
75 75
 
76
-    $this[UNIT_SERVER_PAYMENT_MM_PER_CURRENCY] = function (ValueStorage $vs) {
76
+    $this[UNIT_SERVER_PAYMENT_MM_PER_CURRENCY] = function(ValueStorage $vs) {
77 77
       return new ValueBonused(UNIT_SERVER_PAYMENT_MM_PER_CURRENCY, floatval($vs->getGlobalContainer()->config->payment_currency_exchange_mm_));
78 78
     };
79 79
   }
Please login to merge, or discard this patch.
classes/Unit/Governor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
    * @return int
106 106
    */
107 107
   public function getMaxLevel() {
108
-    $snId =  $this->getSnId();
108
+    $snId = $this->getSnId();
109 109
     return !empty($snId) ? get_unit_param($snId, P_MAX_STACK) : 0;
110 110
   }
111 111
 
Please login to merge, or discard this patch.
includes/includes/ube_attack_calculate.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -165,8 +165,7 @@  discard block
 block discarded – undo
165 165
     $planet_info[PLANET_SYSTEM],
166 166
     $planet_info[PLANET_PLANET],
167 167
     htmlentities($planet_info[PLANET_NAME], ENT_COMPAT, 'UTF-8'),
168
-    $lang[$outcome['UBE_COMBAT_RESULT'] == UBE_COMBAT_RESULT_WIN ? 'ube_report_info_outcome_win' :
169
-      ($outcome['UBE_COMBAT_RESULT'] == UBE_COMBAT_RESULT_DRAW ? 'ube_report_info_outcome_draw' : 'ube_report_info_outcome_loss')]
168
+    $lang[$outcome['UBE_COMBAT_RESULT'] == UBE_COMBAT_RESULT_WIN ? 'ube_report_info_outcome_win' : ($outcome['UBE_COMBAT_RESULT'] == UBE_COMBAT_RESULT_DRAW ? 'ube_report_info_outcome_draw' : 'ube_report_info_outcome_loss')]
170 169
   );
171 170
 
172 171
   $text_defender = '';
@@ -251,7 +250,7 @@  discard block
 block discarded – undo
251 250
       // Просматриваем результаты изменения флотов
252 251
       foreach ($fleet_info[UBE_COUNT] as $unit_id => $unit_count) {
253 252
         // Перебираем аутком на случай восстановления юнитов
254
-        $units_lost = (float)$fleets_outcome[$fleet_id][UBE_UNITS_LOST][$unit_id];
253
+        $units_lost = (float) $fleets_outcome[$fleet_id][UBE_UNITS_LOST][$unit_id];
255 254
 
256 255
         $units_left = $unit_count - $units_lost;
257 256
         if ($fleet_id) {
@@ -275,7 +274,7 @@  discard block
 block discarded – undo
275 274
     // Если во флоте остались юниты или это планета - генерируем изменение ресурсов
276 275
     if ($new_fleet_count || !$fleet_id) {
277 276
       foreach (sn_get_groups('resources_loot') as $resource_id) {
278
-        $resource_change = (float)$fleets_outcome[$fleet_id][UBE_RESOURCES_LOOTED][$resource_id] + (float)$fleets_outcome[$fleet_id][UBE_CARGO_DROPPED][$resource_id];
277
+        $resource_change = (float) $fleets_outcome[$fleet_id][UBE_RESOURCES_LOOTED][$resource_id] + (float) $fleets_outcome[$fleet_id][UBE_CARGO_DROPPED][$resource_id];
279 278
         if ($resource_change) {
280 279
           $resource_db_name = ($fleet_id ? 'fleet_resource_' : '') . pname_resource_name($resource_id);
281 280
           $fleet_delta[$resource_db_name] = -($resource_change);
Please login to merge, or discard this patch.
includes/includes/art_artifact.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 {
5 5
   global $lang;
6 6
 
7
-  if(!in_array($unit_id, sn_get_groups('artifacts')))
7
+  if (!in_array($unit_id, sn_get_groups('artifacts')))
8 8
   {
9 9
     return;
10 10
   }
@@ -13,17 +13,17 @@  discard block
 block discarded – undo
13 13
   $user = db_user_by_id($user['id'], true);
14 14
 
15 15
   $unit_level = $artifact_level_old = mrc_get_level($user, array(), $unit_id, true);
16
-  if($unit_level > 0)
16
+  if ($unit_level > 0)
17 17
   {
18 18
     $db_changeset = array();
19
-    switch($unit_id)
19
+    switch ($unit_id)
20 20
     {
21 21
       case ART_LHC:
22 22
       case ART_HOOK_SMALL:
23 23
       case ART_HOOK_MEDIUM:
24 24
       case ART_HOOK_LARGE:
25 25
         $has_moon = DBStaticPlanet::db_planet_by_parent($planetrow['id'], true, '`id`');
26
-        if($planetrow['planet_type'] == PT_PLANET && !$has_moon['id'])
26
+        if ($planetrow['planet_type'] == PT_PLANET && !$has_moon['id'])
27 27
         {
28 28
           $unit_level--;
29 29
           $updateDebris = false;
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             break;
45 45
           }
46 46
 
47
-          if($moonSize)
47
+          if ($moonSize)
48 48
           {
49 49
             $new_moon_row = uni_create_moon($planetrow['galaxy'], $planetrow['system'], $planetrow['planet'], $user['id'], $moonSize, $updateDebris);
50 50
             $message = sprintf($lang['art_moon_create'][$unit_id], $new_moon_row['name'], uni_render_coordinates($planetrow), HelperString::numberFloorAndFormat($moonSize));
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
       case ART_RCD_MEDIUM:
66 66
       case ART_RCD_LARGE:
67 67
         $planetrow = DBStaticPlanet::db_planet_by_id($planetrow['id'], true);
68
-        if($planetrow['planet_type'] != PT_PLANET)
68
+        if ($planetrow['planet_type'] != PT_PLANET)
69 69
         {
70 70
           $message = $lang['art_rcd_err_moon'];
71 71
           break;
72 72
         }
73 73
 
74 74
         $que = que_get($user['id'], $planetrow['id'], QUE_STRUCTURES, false);
75
-        if(!empty($que['items']))
75
+        if (!empty($que['items']))
76 76
         {
77 77
           $message = $lang['art_rcd_err_que'];
78 78
           break;
@@ -81,15 +81,15 @@  discard block
 block discarded – undo
81 81
         $artifact_deploy = get_unit_param($unit_id, P_DEPLOY);
82 82
 
83 83
         $sectors_used = 0;
84
-        foreach($artifact_deploy as $deploy_unit_id => $deploy_unit_level)
84
+        foreach ($artifact_deploy as $deploy_unit_id => $deploy_unit_level)
85 85
         {
86
-          if(!($levels_deployed = max(0, $deploy_unit_level - mrc_get_level($user, $planetrow, $deploy_unit_id, true, true))))
86
+          if (!($levels_deployed = max(0, $deploy_unit_level - mrc_get_level($user, $planetrow, $deploy_unit_id, true, true))))
87 87
             continue;
88 88
           $sectors_used += $levels_deployed;
89 89
           $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($deploy_unit_id, $levels_deployed, $user, $planetrow['id']);
90 90
         }
91 91
 
92
-        if($sectors_used == 0)
92
+        if ($sectors_used == 0)
93 93
         {
94 94
           $message = $lang['art_rcd_err_no_sense'];
95 95
           break;
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
         $que_item = null;
105 105
         $que = que_get($user['id'], $planetrow['id'], QUE_RESEARCH, true);
106 106
         $current_que = &$que['ques'][QUE_RESEARCH][$user['id']][0];
107
-        if(!empty($current_que))
107
+        if (!empty($current_que))
108 108
         {
109 109
           reset($current_que);
110 110
           $que_item = &$que['ques'][QUE_RESEARCH][$user['id']][0][key($current_que)];
111 111
         }
112 112
 
113
-        if(!empty($que_item) && $que_item['que_time_left'] > 60)
113
+        if (!empty($que_item) && $que_item['que_time_left'] > 60)
114 114
         {
115 115
           $unit_level--;
116 116
           $old_time = $que_item['que_time_left'];
@@ -131,13 +131,13 @@  discard block
 block discarded – undo
131 131
         $que = que_get($user['id'], $planetrow['id'], QUE_STRUCTURES, true);
132 132
         $current_que = &$que['ques'][QUE_STRUCTURES][$user['id']][$planetrow['id']];
133 133
         // $que_item = &$que['que'][QUE_STRUCTURES][0];
134
-        if(!empty($current_que))
134
+        if (!empty($current_que))
135 135
         {
136 136
           reset($current_que);
137 137
           $que_item = &$que['ques'][QUE_STRUCTURES][$user['id']][$planetrow['id']][key($current_que)];
138 138
         }
139 139
 
140
-        if(isset($que_item) && $que_item['que_time_left'] > 60)
140
+        if (isset($que_item) && $que_item['que_time_left'] > 60)
141 141
         {
142 142
           $unit_level--;
143 143
           $old_time = $que_item['que_time_left'];
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
       break;
156 156
 
157 157
     }
158
-    if($unit_level != $artifact_level_old)
158
+    if ($unit_level != $artifact_level_old)
159 159
     {
160 160
       $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($unit_id, $unit_level - $artifact_level_old, $user);
161 161
       OldDbChangeSet::db_changeset_apply($db_changeset);
Please login to merge, or discard this patch.