Completed
Push — work-fleets ( 961997...006942 )
by SuperNova.WS
06:22
created
classes/DbResultIterator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@
 block discarded – undo
125 125
    * @since 5.1.0
126 126
    */
127 127
   public function count() {
128
-    throw new Exception('You should implement ' . get_called_class() . '::count()');
128
+    throw new Exception('You should implement '.get_called_class().'::count()');
129 129
   }
130 130
 
131 131
 }
Please login to merge, or discard this patch.
classes/PropertyHiderInObject.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
 class PropertyHiderInObject extends PropertyHider {
4 4
   private function getPhysicalPropertyName($name) {
5
-    return '_' . $name;
5
+    return '_'.$name;
6 6
   }
7 7
 
8 8
   /**
Please login to merge, or discard this patch.
classes/sn_module.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
   }
73 73
 
74 74
   function loadModuleRootConfig() {
75
-    require SN_ROOT_PHYSICAL . 'config.php';
75
+    require SN_ROOT_PHYSICAL.'config.php';
76 76
 
77
-    $module_config_array = get_class($this) . '_config';
78
-    if(!empty($$module_config_array) && is_array($$module_config_array)) {
77
+    $module_config_array = get_class($this).'_config';
78
+    if (!empty($$module_config_array) && is_array($$module_config_array)) {
79 79
       $this->config = $$module_config_array;
80 80
 
81 81
       return true;
@@ -93,17 +93,17 @@  discard block
 block discarded – undo
93 93
 
94 94
     // TODO: Load configuration from DB. Manifest setting
95 95
     // Trying to load configuration from file
96
-    if(!$config_exists = $this->loadModuleRootConfig()) {
96
+    if (!$config_exists = $this->loadModuleRootConfig()) {
97 97
       // Конфигурация может лежать в config_path в манифеста или в корне модуля
98
-      if(isset($this->manifest['config_path']) && file_exists($config_filename = $this->manifest['config_path'] . '/config.php')) {
98
+      if (isset($this->manifest['config_path']) && file_exists($config_filename = $this->manifest['config_path'].'/config.php')) {
99 99
         $config_exists = true;
100
-      } elseif(file_exists($config_filename = dirname($filename) . '/config.php')) {
100
+      } elseif (file_exists($config_filename = dirname($filename).'/config.php')) {
101 101
         $config_exists = true;
102 102
       }
103 103
 
104
-      if($config_exists) {
104
+      if ($config_exists) {
105 105
         include($config_filename);
106
-        $module_config_array = $class_module_name . '_config';
106
+        $module_config_array = $class_module_name.'_config';
107 107
         $this->config = $$module_config_array;
108 108
       }
109 109
     }
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
     // Checking module status - is it installed and active
120 120
     $this->check_status();
121
-    if(!$this->manifest['active']) {
121
+    if (!$this->manifest['active']) {
122 122
       return;
123 123
     }
124 124
 
@@ -138,11 +138,11 @@  discard block
 block discarded – undo
138 138
 
139 139
   protected function setSystemConstants() {
140 140
     // Setting constants - if any
141
-    if(empty($this->manifest['constants']) || !is_array($this->manifest['constants'])) {
141
+    if (empty($this->manifest['constants']) || !is_array($this->manifest['constants'])) {
142 142
       return;
143 143
     }
144 144
 
145
-    foreach($this->manifest['constants'] as $constant_name => $constant_value) {
145
+    foreach ($this->manifest['constants'] as $constant_name => $constant_value) {
146 146
       !defined($constant_name) ? define($constant_name, $constant_value) : false;
147 147
     }
148 148
   }
@@ -154,48 +154,48 @@  discard block
 block discarded – undo
154 154
     // New values from module variables will overwrite previous values (for root variables) and array elements with corresponding indexes (for arrays)
155 155
     // Constants as array indexes are honored - it's make valid such declarations as 'sn_data[ques][QUE_STRUCTURES]'
156 156
     $this->manifest['vars'] = $this->__assign_vars();
157
-    if(empty($this->manifest['vars']) || !is_array($this->manifest['vars'])) {
157
+    if (empty($this->manifest['vars']) || !is_array($this->manifest['vars'])) {
158 158
       return;
159 159
     }
160 160
 
161 161
     $vars_assigned = array();
162
-    foreach($this->manifest['vars'] as $var_name => $var_value) {
162
+    foreach ($this->manifest['vars'] as $var_name => $var_value) {
163 163
       $sub_vars = explode('[', str_replace(']', '', $var_name));
164 164
       $var_name = $sub_vars[0];
165 165
 
166
-      if(!isset($vars_assigned[$var_name])) {
166
+      if (!isset($vars_assigned[$var_name])) {
167 167
         $vars_assigned[$var_name] = true;
168 168
         global $$var_name;
169 169
       }
170 170
 
171 171
       $pointer = &$$var_name;
172
-      if(($n = count($sub_vars)) > 1) {
173
-        for($i = 1; $i < $n; $i++) {
174
-          if(defined($sub_vars[$i])) {
172
+      if (($n = count($sub_vars)) > 1) {
173
+        for ($i = 1; $i < $n; $i++) {
174
+          if (defined($sub_vars[$i])) {
175 175
             $sub_vars[$i] = constant($sub_vars[$i]);
176 176
           }
177 177
 
178
-          if(!isset($pointer[$sub_vars[$i]]) && $i != $n) {
178
+          if (!isset($pointer[$sub_vars[$i]]) && $i != $n) {
179 179
             $pointer[$sub_vars[$i]] = array();
180 180
           }
181 181
           $pointer = &$pointer[$sub_vars[$i]];
182 182
         }
183 183
       }
184 184
 
185
-      if(!isset($pointer) || !is_array($pointer)) {
185
+      if (!isset($pointer) || !is_array($pointer)) {
186 186
         $pointer = $var_value;
187
-      } elseif(is_array($$var_name)) {
187
+      } elseif (is_array($$var_name)) {
188 188
         $pointer = array_merge_recursive_numeric($pointer, $var_value);
189 189
       }
190 190
     }
191 191
   }
192 192
 
193 193
   protected function mergeMenu(&$sn_menu_extra, &$menu_patch) {
194
-    if(!is_array($menu_patch)) {
194
+    if (!is_array($menu_patch)) {
195 195
       return;
196 196
     }
197 197
 
198
-    foreach($menu_patch as $menu_item_name => $menu_item_data) {
198
+    foreach ($menu_patch as $menu_item_name => $menu_item_data) {
199 199
       $sn_menu_extra[$menu_item_name] = $menu_item_data;
200 200
     }
201 201
   }
@@ -204,34 +204,34 @@  discard block
 block discarded – undo
204 204
     // Overriding function if any
205 205
     sn_sys_handler_add(classSupernova::$functions, $this->manifest['functions'], $this);
206 206
 
207
-    foreach(classSupernova::$sn_mvc as $handler_type => &$handler_data) {
207
+    foreach (classSupernova::$sn_mvc as $handler_type => &$handler_data) {
208 208
       sn_sys_handler_add($handler_data, $this->manifest['mvc'][$handler_type], $this, $handler_type);
209 209
     }
210 210
   }
211 211
 
212 212
   protected function mergeNavbarButton() {
213
-    if(empty($this->manifest['navbar_prefix_button']) || !is_array($this->manifest['navbar_prefix_button'])) {
213
+    if (empty($this->manifest['navbar_prefix_button']) || !is_array($this->manifest['navbar_prefix_button'])) {
214 214
       return;
215 215
     }
216 216
 
217
-    foreach($this->manifest['navbar_prefix_button'] as $button_image => $button_url_relative) {
217
+    foreach ($this->manifest['navbar_prefix_button'] as $button_image => $button_url_relative) {
218 218
       classSupernova::$sn_mvc['navbar_prefix_button'][$button_image] = $button_url_relative;
219 219
     }
220 220
   }
221 221
 
222 222
   protected function mergeI18N() {
223 223
     $arrayName = 'i18n';
224
-    if(empty($this->manifest[$arrayName]) || !is_array($this->manifest[$arrayName])) {
224
+    if (empty($this->manifest[$arrayName]) || !is_array($this->manifest[$arrayName])) {
225 225
       return;
226 226
     }
227 227
 
228
-    foreach($this->manifest[$arrayName] as $pageName => &$contentList) {
229
-      foreach($contentList as &$i18n_file_data) {
230
-        if(is_array($i18n_file_data) && !$i18n_file_data['path']) {
228
+    foreach ($this->manifest[$arrayName] as $pageName => &$contentList) {
229
+      foreach ($contentList as &$i18n_file_data) {
230
+        if (is_array($i18n_file_data) && !$i18n_file_data['path']) {
231 231
           $i18n_file_data['path'] = $this->manifest['root_relative'];
232 232
         }
233 233
       }
234
-      if(!isset(classSupernova::$sn_mvc[$arrayName][$pageName])) {
234
+      if (!isset(classSupernova::$sn_mvc[$arrayName][$pageName])) {
235 235
         classSupernova::$sn_mvc[$arrayName][$pageName] = array();
236 236
       }
237 237
       classSupernova::$sn_mvc[$arrayName][$pageName] += $contentList;
@@ -239,13 +239,13 @@  discard block
 block discarded – undo
239 239
   }
240 240
 
241 241
   protected function mergeArraySpecial($arrayName) {
242
-    if(empty($this->manifest[$arrayName]) || !is_array($this->manifest[$arrayName])) {
242
+    if (empty($this->manifest[$arrayName]) || !is_array($this->manifest[$arrayName])) {
243 243
       return;
244 244
     }
245 245
 
246
-    foreach($this->manifest[$arrayName] as $pageName => &$contentList) {
246
+    foreach ($this->manifest[$arrayName] as $pageName => &$contentList) {
247 247
       !isset(classSupernova::$sn_mvc[$arrayName][$pageName]) ? classSupernova::$sn_mvc[$arrayName][$pageName] = array() : false;
248
-      foreach($contentList as $contentName => &$content) {
248
+      foreach ($contentList as $contentName => &$content) {
249 249
         classSupernova::$sn_mvc[$arrayName][$pageName][$contentName] = $content;
250 250
       }
251 251
     }
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
           $load_order[$loaded_module_name] = $level;
300 300
         }
301 301
       }
302
-    } while($prev_order != $load_order);
302
+    } while ($prev_order != $load_order);
303 303
 
304 304
     asort($load_order);
305 305
 
Please login to merge, or discard this patch.
classes/DBLock.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,6 +30,6 @@
 block discarded – undo
30 30
 
31 31
 
32 32
   public function addPlayerLock($table, $playerIdFieldName) {
33
-    $this->lock_player[$table . '-' . $playerIdFieldName] = array($table, $playerIdFieldName);
33
+    $this->lock_player[$table.'-'.$playerIdFieldName] = array($table, $playerIdFieldName);
34 34
   }
35 35
 }
Please login to merge, or discard this patch.
classes/DbSqlHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,13 +15,13 @@
 block discarded – undo
15 15
    * @return string
16 16
    */
17 17
   public static function quoteComment($comment) {
18
-    if($comment == '') {
18
+    if ($comment == '') {
19 19
       return '';
20 20
     }
21 21
 
22
-    $comment = str_replace(array('/*', '*/'), '__',$comment);
22
+    $comment = str_replace(array('/*', '*/'), '__', $comment);
23 23
 
24
-    return "\r\n/*" . $comment . "*/";
24
+    return "\r\n/*".$comment."*/";
25 25
   }
26 26
 
27 27
 }
Please login to merge, or discard this patch.
classes/DbQueryConstructor.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
   // TODO - rewrite
229 229
   public function getParamsFromStaticClass($className) {
230 230
     if (is_string($className) && $className && class_exists($className)) {
231
-      if(method_exists($className, 'getDb')) {
231
+      if (method_exists($className, 'getDb')) {
232 232
         $this->setDb($className::getDb());
233 233
       }
234 234
       $this->from($className::$_table);
@@ -317,9 +317,9 @@  discard block
 block discarded – undo
317 317
   }
318 318
 
319 319
   protected function compileFrom() {
320
-    $this->_compiledQuery[] = 'FROM `{{' . $this->escapeString($this->table) . '}}`';
320
+    $this->_compiledQuery[] = 'FROM `{{'.$this->escapeString($this->table).'}}`';
321 321
     if (!empty($this->alias)) {
322
-      $this->_compiledQuery[] = 'AS `' . $this->escapeString($this->alias) . '`';
322
+      $this->_compiledQuery[] = 'AS `'.$this->escapeString($this->alias).'`';
323 323
     }
324 324
   }
325 325
 
@@ -329,29 +329,29 @@  discard block
 block discarded – undo
329 329
 
330 330
   protected function compileWhere() {
331 331
     // TODO - fields should be escaped !!
332
-    !empty($this->where) ? $this->_compiledQuery[] = 'WHERE ' . implode(' AND ', $this->where) : false;
332
+    !empty($this->where) ? $this->_compiledQuery[] = 'WHERE '.implode(' AND ', $this->where) : false;
333 333
   }
334 334
 
335 335
   protected function compileGroupBy() {
336 336
     // TODO - fields should be escaped !!
337 337
 //    !empty($this->groupBy) ? $this->_compiledQuery[] = 'GROUP BY ' . implode(',', $this->arrayEscape($this->groupBy)) : false;
338
-    !empty($this->groupBy) ? $this->_compiledQuery[] = 'GROUP BY ' . $this->selectFieldsToString($this->groupBy) : false;
338
+    !empty($this->groupBy) ? $this->_compiledQuery[] = 'GROUP BY '.$this->selectFieldsToString($this->groupBy) : false;
339 339
   }
340 340
 
341 341
   protected function compileOrderBy() {
342 342
     // TODO - fields should be escaped !!
343
-    !empty($this->orderBy) ? $this->_compiledQuery[] = 'ORDER BY ' . implode(',', $this->arrayEscape($this->orderBy)) : false;
343
+    !empty($this->orderBy) ? $this->_compiledQuery[] = 'ORDER BY '.implode(',', $this->arrayEscape($this->orderBy)) : false;
344 344
   }
345 345
 
346 346
   protected function compileHaving() {
347 347
     // TODO - fields should be escaped !!
348
-    !empty($this->having) ? $this->_compiledQuery[] = 'HAVING ' . implode(' AND ', $this->having) : false;
348
+    !empty($this->having) ? $this->_compiledQuery[] = 'HAVING '.implode(' AND ', $this->having) : false;
349 349
   }
350 350
 
351 351
   protected function compileLimit() {
352 352
     // TODO - fields should be escaped !!
353 353
     if ($limit = $this->fetchOne ? 1 : $this->limit) {
354
-      $this->_compiledQuery[] = 'LIMIT ' . $limit . (!empty($this->offset) ? ' OFFSET ' . $this->offset : '');
354
+      $this->_compiledQuery[] = 'LIMIT '.$limit.(!empty($this->offset) ? ' OFFSET '.$this->offset : '');
355 355
     }
356 356
   }
357 357
 
@@ -395,14 +395,14 @@  discard block
 block discarded – undo
395 395
    */
396 396
   protected function processField($fieldName) {
397 397
     if (is_bool($fieldName)) {
398
-      $result = (string)intval($fieldName);
398
+      $result = (string) intval($fieldName);
399 399
     } elseif (is_numeric($fieldName)) {
400 400
       $result = $fieldName;
401 401
     } elseif (is_null($fieldName)) {
402 402
       $result = 'NULL';
403 403
     } else {
404 404
       // Field has other type - string or should be convertible to string
405
-      $result = (string)$fieldName;
405
+      $result = (string) $fieldName;
406 406
       if (!$fieldName instanceof DbSqlLiteral) {
407 407
         $result = $this->quoteField($fieldName);
408 408
       }
Please login to merge, or discard this patch.
classes/DBStatic/DBStaticQue.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     if ($que_type == QUE_RESEARCH || $planet_id === null) {
39 39
       $query[] = "`que_planet_id` IS NULL";
40 40
     } elseif ($planet_id) {
41
-      $query[] = "(`que_planet_id` = {$planet_id}" . ($que_type ? '' : ' OR que_planet_id IS NULL') . ")";
41
+      $query[] = "(`que_planet_id` = {$planet_id}".($que_type ? '' : ' OR que_planet_id IS NULL').")";
42 42
     }
43 43
     if ($que_type) {
44 44
       $query[] = "`que_type` = {$que_type}";
Please login to merge, or discard this patch.
classes/Pimple/Container.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -239,7 +239,7 @@
 block discarded – undo
239 239
 
240 240
         $factory = $this->values[$id];
241 241
 
242
-        $extended = function ($c) use ($callable, $factory) {
242
+        $extended = function($c) use ($callable, $factory) {
243 243
             return $callable($factory($c), $c);
244 244
         };
245 245
 
Please login to merge, or discard this patch.
classes/Unit.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -154,15 +154,15 @@  discard block
 block discarded – undo
154 154
    * @param string $group_name
155 155
    */
156 156
   public static function _init($group_name = '') {
157
-    if(static::$_is_static_init) {
157
+    if (static::$_is_static_init) {
158 158
       return;
159 159
     }
160 160
 
161
-    if($group_name) {
161
+    if ($group_name) {
162 162
       static::$_sn_group_name = $group_name;
163 163
     }
164 164
 
165
-    if(static::$_sn_group_name) {
165
+    if (static::$_sn_group_name) {
166 166
       static::$_group_unit_id_list = sn_get_groups(static::$_sn_group_name);
167 167
       empty(static::$_group_unit_id_list) ? static::$_group_unit_id_list = array() : false;
168 168
     }
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
     // TODO - Reset combat stats??
188 188
     $this->_unitId = $unitId;
189 189
 
190
-    if($this->_unitId) {
190
+    if ($this->_unitId) {
191 191
       $this->info = get_unit_param($this->_unitId);
192 192
       $this->_type = $this->info[P_UNIT_TYPE];
193 193
     } else {
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 
199 199
   protected function setCount($value) {
200 200
     // TODO - Reset combat stats??
201
-    if($value < 0) {
201
+    if ($value < 0) {
202 202
       classSupernova::$debug->error('Can not set Unit::$count to negative value');
203 203
     }
204 204
     $this->_count = $value;
Please login to merge, or discard this patch.