Test Failed
Push — trunk ( b3f953...fb036a )
by SuperNova.WS
05:47
created
language/en/chat_advanced.mo.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 * DO NOT CHANGE
24 24
 */
25 25
 
26
-if (!defined('INSIDE')) die();
26
+if (!defined('INSIDE')) {
27
+  die();
28
+}
27 29
 
28 30
 //$lang = array_merge($lang,
29 31
 //$lang->merge(
Please login to merge, or discard this patch.
includes/functions/eco_get_build_data.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
     $query                       = DBStaticUnit::db_unit_list_laboratories($user['id']);
20 20
     while ($row = db_fetch($query)) {
21 21
       if (!eco_unit_busy($user, $row, UNIT_TECHNOLOGIES)) {
22
-        $row                                     += array(
22
+        $row += array(
23 23
           STRUC_LABORATORY             => $level_lab = mrc_get_level($user, $row, STRUC_LABORATORY),
24 24
           STRUC_LABORATORY_NANO        => $level_lab_nano = mrc_get_level($user, $row, STRUC_LABORATORY_NANO),
25 25
           'laboratory_effective_level' => $level_lab * pow(2, $level_lab_nano),
Please login to merge, or discard this patch.
includes/general/general.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -332,7 +332,7 @@
 block discarded – undo
332 332
     $time_left     = min(floor($time_left / PERIOD_DAY), $term_original);
333 333
     $cost_left     = $term_original > 0 ? ceil($time_left / $term_original * $original_cost) : 0;
334 334
 
335
-    array_walk_recursive($result, function (&$value) use ($cost_left) {
335
+    array_walk_recursive($result, function(&$value) use ($cost_left) {
336 336
       $value -= $cost_left;
337 337
     });
338 338
   }
Please login to merge, or discard this patch.
classes/Pages/Deprecated/PageImperium.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -262,7 +262,7 @@
 block discarded – undo
262 262
     foreach ($planets as $planetId => $planet) {
263 263
       $templatizedPlanet = tpl_parse_planet($user, $planet);
264 264
 
265
-      if($planet['planet_type'] == PT_MOON) {
265
+      if ($planet['planet_type'] == PT_MOON) {
266 266
         $parentPlanet = DBStaticPlanet::db_planet_by_id($planet['parent_planet']);
267 267
       } else {
268 268
         $parentPlanet = $planet;
Please login to merge, or discard this patch.
admin/adm_planet_list.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-define('INSIDE'  , true);
4
-define('INSTALL' , false);
3
+define('INSIDE', true);
4
+define('INSTALL', false);
5 5
 define('IN_ADMIN', true);
6 6
 
7 7
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 SnTemplate::messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR);
12 12
 
13 13
 $planet_active = sys_get_param_int('planet_active');
14
-if(!$planet_active) {
14
+if (!$planet_active) {
15 15
   $planet_type = sys_get_param_int('planet_type', 1);
16 16
   $planet_type = $planet_type == 3 ? 3 : 1;
17 17
 } else {
@@ -40,8 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
 $page_title =
42 42
   $lang['adm_planet_list_title'] . ': ' .
43
-  ($planet_active ? $lang['adm_planet_active'] :
44
-    ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '')
43
+  ($planet_active ? $lang['adm_planet_active'] : ($planet_type ? ($planet_type == 3 ? $lang['sys_moons'] : $lang['sys_planets']) : '')
45 44
   );
46 45
 $template->assign_vars(array(
47 46
   'PAGE_TITLE' => $page_title,
Please login to merge, or discard this patch.
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::$gc->modules->countModulesInGroup('payment') && !SN_GOOGLE) {
5
+if (SN::$gc->modules->countModulesInGroup('payment') && !SN_GOOGLE) {
6 6
   sys_redirect('metamatter.php');
7 7
 }
8 8
 
Please login to merge, or discard this patch.
classes/Fleet/FleetStatic.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
    * @return DbMysqliResultIterator|EmptyCountableIterator
19 19
    */
20 20
   public static function dbFleetsOnHoldOnPlanetsByIds($planetIds, $time = SN_TIME_NOW) {
21
-    if(empty($planetIds) || !is_array($planetIds)) {
21
+    if (empty($planetIds) || !is_array($planetIds)) {
22 22
       return new EmptyCountableIterator();
23 23
     }
24 24
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     $speeds = array();
42 42
     if (!empty($fleet)) {
43 43
       foreach ($fleet as $ship_id => $amount) {
44
-        if ($amount && in_array($ship_id, sn_get_groups(['fleet', 'missile',]))) {
44
+        if ($amount && in_array($ship_id, sn_get_groups(['fleet', 'missile', ]))) {
45 45
           $single_ship_data = !empty($shipData[$ship_id]) ? $shipData[$ship_id] : get_ship_data($ship_id, $user);
46 46
           $speeds[]         = $single_ship_data['speed'];
47 47
         }
Please login to merge, or discard this patch.
classes/Template/TemplateMeta.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@
 block discarded – undo
136 136
 //    var_dump($fallBackPath);
137 137
 //    var_dump($template);
138 138
 
139
-    if(empty($fallBackPath)) {
139
+    if (empty($fallBackPath)) {
140 140
       if (!$this->parent || empty($fallbackName = $this->parent->getName()) || !$this->isTemplateExists()) {
141 141
         // If no parent template - then using default template as fallback one
142 142
         $fallbackName = SnTemplate::SN_TEMPLATE_NAME_DEFAULT;
Please login to merge, or discard this patch.
classes/classPersistent.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     $this->sql_index_field = "{$table_name}_name";
41 41
     $this->sql_value_field = "{$table_name}_value";
42 42
 
43
-    if(!$this->_DB_LOADED) {
43
+    if (!$this->_DB_LOADED) {
44 44
       $this->db_loadAll();
45 45
     }
46 46
   }
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
    */
61 61
   public function db_loadItem($index) {
62 62
     $result = null;
63
-    if($index) {
63
+    if ($index) {
64 64
       $index_safe = SN::$db->db_escape($index);
65 65
       $queryResult = doquery("SELECT `{$this->sql_value_field}` FROM `{{{$this->table_name}}}` WHERE `{$this->sql_index_field}` = '{$index_safe}' FOR UPDATE", true);
66
-      if(is_array($queryResult) && !empty($queryResult)) {
66
+      if (is_array($queryResult) && !empty($queryResult)) {
67 67
         $this->$index = $result = $queryResult[$this->sql_value_field];
68 68
       }
69 69
     }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     $this->loadDefaults();
76 76
 
77 77
     $query = doquery("SELECT * FROM {{{$this->table_name}}} FOR UPDATE;");
78
-    while($row = db_fetch($query)) {
78
+    while ($row = db_fetch($query)) {
79 79
       $this[$row[$this->sql_index_field]] = $row[$this->sql_value_field];
80 80
     }
81 81
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
   }
84 84
 
85 85
   public function loadDefaults() {
86
-    foreach($this->defaults as $defName => $defValue) {
86
+    foreach ($this->defaults as $defName => $defValue) {
87 87
       $this->$defName = $defValue;
88 88
     }
89 89
   }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
   }
94 94
 
95 95
   public function db_saveItem($item_list, $value = NULL) {
96
-    if(empty($item_list)) {
96
+    if (empty($item_list)) {
97 97
       return;
98 98
     }
99 99
 
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 
102 102
     // Сначала записываем данные в базу - что бы поймать все блокировки
103 103
     $qry = array();
104
-    foreach($item_list as $item_name => $item_value) {
105
-      if($item_name) {
104
+    foreach ($item_list as $item_name => $item_value) {
105
+      if ($item_name) {
106 106
         $item_value = SN::$db->db_escape($item_value === NULL ? $this->$item_name : $item_value);
107 107
         $item_name = SN::$db->db_escape($item_name);
108 108
         $qry[] = "('{$item_name}', '{$item_value}')";
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
     doquery("REPLACE INTO `{{" . $this->table_name . "}}` (`{$this->sql_index_field}`, `{$this->sql_value_field}`) VALUES " . implode(',', $qry) . ";");
112 112
 
113 113
     // И только после взятия блокировок - меняем значения в кэше
114
-    foreach($item_list as $item_name => $item_value) {
115
-      if($item_name && $item_value !== null) {
114
+    foreach ($item_list as $item_name => $item_value) {
115
+      if ($item_name && $item_value !== null) {
116 116
         $this->__set($item_name, $item_value);
117 117
       }
118 118
     }
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
   }
141 141
 
142 142
   public function __get($name) {
143
-    if($this->force) {
143
+    if ($this->force) {
144 144
       $this->force = false;
145 145
       $value = $this->db_loadItem($name);
146 146
     } else {
147 147
       $value = parent::__get($name);
148 148
     }
149 149
 
150
-    if(isset($this->notEmptyFields[$name]) && empty($value) && isset($this->defaults[$name])) {
150
+    if (isset($this->notEmptyFields[$name]) && empty($value) && isset($this->defaults[$name])) {
151 151
       $value = $this->defaults[$name];
152 152
     }
153 153
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
   }
156 156
 
157 157
   public function __set($name, $value) {
158
-    if($this->force) {
158
+    if ($this->force) {
159 159
       $this->force = false;
160 160
       $this->db_saveItem($name, $value);
161 161
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     $this->db_saveItem(array_combine(array_keys($this->defaults), array_fill(0, count($this->defaults), null)));
93 93
   }
94 94
 
95
-  public function db_saveItem($item_list, $value = NULL) {
95
+  public function db_saveItem($item_list, $value = null) {
96 96
     if(empty($item_list)) {
97 97
       return;
98 98
     }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
     $qry = array();
104 104
     foreach($item_list as $item_name => $item_value) {
105 105
       if($item_name) {
106
-        $item_value = SN::$db->db_escape($item_value === NULL ? $this->$item_name : $item_value);
106
+        $item_value = SN::$db->db_escape($item_value === null ? $this->$item_name : $item_value);
107 107
         $item_name = SN::$db->db_escape($item_name);
108 108
         $qry[] = "('{$item_name}', '{$item_value}')";
109 109
       }
Please login to merge, or discard this patch.