Completed
Push — work-fleets ( 8f8df9...1920ae )
by SuperNova.WS
06:30
created
includes/init.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Защита от двойного инита
4
-if(defined('INIT')) {
4
+if (defined('INIT')) {
5 5
   return;
6 6
 }
7 7
 
@@ -19,22 +19,22 @@  discard block
 block discarded – undo
19 19
 define('SN_DEBUG_PDUMP_CALLER', true);
20 20
 
21 21
 // Бенчмарк
22
-register_shutdown_function(function () {
23
-  if(defined('IN_AJAX')) {
22
+register_shutdown_function(function() {
23
+  if (defined('IN_AJAX')) {
24 24
     return;
25 25
   }
26 26
 
27 27
   global $user, $locale_cache_statistic;
28 28
 
29
-  print('<hr><div class="benchmark">Benchmark ' . (microtime(true) - SN_TIME_MICRO) . 's, memory: ' . number_format(memory_get_usage() - SN_MEM_START) .
30
-    (!empty($locale_cache_statistic['misses']) ? ', LOCALE MISSED' : '') .
31
-    (class_exists('classSupernova') && is_object(classSupernova::$db) ? ', DB time: ' . classSupernova::$db->time_mysql_total . 'ms' : '') .
29
+  print('<hr><div class="benchmark">Benchmark '.(microtime(true) - SN_TIME_MICRO).'s, memory: '.number_format(memory_get_usage() - SN_MEM_START).
30
+    (!empty($locale_cache_statistic['misses']) ? ', LOCALE MISSED' : '').
31
+    (class_exists('classSupernova') && is_object(classSupernova::$db) ? ', DB time: '.classSupernova::$db->time_mysql_total.'ms' : '').
32 32
     '</div>');
33
-  if($user['authlevel'] >= 2 && file_exists(SN_ROOT_PHYSICAL . 'badqrys.txt') && @filesize(SN_ROOT_PHYSICAL . 'badqrys.txt') > 0) {
33
+  if ($user['authlevel'] >= 2 && file_exists(SN_ROOT_PHYSICAL.'badqrys.txt') && @filesize(SN_ROOT_PHYSICAL.'badqrys.txt') > 0) {
34 34
     echo '<a href="badqrys.txt" target="_blank" style="color:red">', 'HACK ALERT!', '</a>';
35 35
   }
36 36
 
37
-  if(!empty($locale_cache_statistic['misses'])) {
37
+  if (!empty($locale_cache_statistic['misses'])) {
38 38
     print('<!--');
39 39
     pdump($locale_cache_statistic);
40 40
     print('-->');
@@ -54,47 +54,47 @@  discard block
 block discarded – undo
54 54
 
55 55
 define('SN_TIME_NOW_GMT_STRING', gmdate(DATE_ATOM, SN_TIME_NOW));
56 56
 
57
-if(strpos(strtolower($_SERVER['SERVER_NAME']), 'google.') !== false) {
57
+if (strpos(strtolower($_SERVER['SERVER_NAME']), 'google.') !== false) {
58 58
   define('SN_GOOGLE', true);
59 59
 }
60 60
 
61 61
 // Эти три строки должны быть В ЭТОМ ФАЙЛЕ, ПО ЭТОМУ ПУТИ и ПЕРЕД ЭТИМ ИНКЛЮДОМ!!!
62
-define('SN_ROOT_PHYSICAL', str_replace(array('\\', '//'), '/', dirname(__DIR__) . '/'));
62
+define('SN_ROOT_PHYSICAL', str_replace(array('\\', '//'), '/', dirname(__DIR__).'/'));
63 63
 define('SN_ROOT_PHYSICAL_STR_LEN', strlen(SN_ROOT_PHYSICAL));
64 64
 $phpbb_root_path = SN_ROOT_PHYSICAL; // Это нужно для работы PTL
65 65
 
66
-$sn_root_relative = str_replace(array('\\', '//'), '/', getcwd() . '/');
66
+$sn_root_relative = str_replace(array('\\', '//'), '/', getcwd().'/');
67 67
 //$sn_root_relative .= $sn_root_relative[strlen($sn_root_relative) - 1] == '/' ? '' : '/';
68 68
 $sn_root_relative = str_replace(SN_ROOT_PHYSICAL, '', $sn_root_relative);
69 69
 $sn_root_relative .= basename($_SERVER['SCRIPT_NAME']);
70 70
 $sn_root_relative = str_replace($sn_root_relative, '', $_SERVER['SCRIPT_NAME']);
71 71
 define('SN_ROOT_RELATIVE', $sn_root_relative);
72 72
 
73
-define('SN_ROOT_VIRTUAL', 'http' . (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . SN_ROOT_RELATIVE);
73
+define('SN_ROOT_VIRTUAL', 'http'.(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '').'://'.$_SERVER['HTTP_HOST'].SN_ROOT_RELATIVE);
74 74
 define('SN_ROOT_VIRTUAL_PARENT', str_replace('//google.', '//', SN_ROOT_VIRTUAL));
75 75
 
76 76
 $phpEx = strpos($phpEx = substr(strrchr(__FILE__, '.'), 1), '/') === false ? $phpEx : '';
77 77
 define('PHP_EX', $phpEx); // PHP extension on this server
78
-define('DOT_PHP_EX', '.' . PHP_EX); // PHP extension on this server
78
+define('DOT_PHP_EX', '.'.PHP_EX); // PHP extension on this server
79 79
 
80 80
 
81 81
 header('Content-type: text/html; charset=utf-8');
82 82
 ob_start();
83 83
 ini_set('error_reporting', E_ALL ^ E_NOTICE);
84 84
 
85
-empty($classRoot) ? $classRoot = SN_ROOT_PHYSICAL . 'includes/classes/' : false;
86
-spl_autoload_register(function ($class) use ($classRoot) {
85
+empty($classRoot) ? $classRoot = SN_ROOT_PHYSICAL.'includes/classes/' : false;
86
+spl_autoload_register(function($class) use ($classRoot) {
87 87
   $class = str_replace('\\', '/', $class);
88
-  if (file_exists($classRoot . $class . '.php')) {
89
-    require_once $classRoot . $class . '.php';
90
-  } elseif (file_exists($classRoot . 'UBE/' . $class . '.php')) {
91
-    require_once $classRoot . 'UBE/' . $class . '.php';
88
+  if (file_exists($classRoot.$class.'.php')) {
89
+    require_once $classRoot.$class.'.php';
90
+  } elseif (file_exists($classRoot.'UBE/'.$class.'.php')) {
91
+    require_once $classRoot.'UBE/'.$class.'.php';
92 92
   }
93 93
 });
94 94
 
95 95
 require_once 'constants.php';
96
-require_once SN_ROOT_PHYSICAL . "includes/db" . DOT_PHP_EX;
97
-require_once(SN_ROOT_PHYSICAL . "includes/init/init_functions" . DOT_PHP_EX);
96
+require_once SN_ROOT_PHYSICAL."includes/db".DOT_PHP_EX;
97
+require_once(SN_ROOT_PHYSICAL."includes/init/init_functions".DOT_PHP_EX);
98 98
 
99 99
 /**
100 100
  * @var classConfig    $config
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
 // define('BE_DEBUG', true); // Отладка боевого движка
115 115
 classSupernova::init_debug_state();
116 116
 
117
-require_once(SN_ROOT_PHYSICAL . "includes/vars/vars" . DOT_PHP_EX);
118
-require_once(SN_ROOT_PHYSICAL . "includes/general" . DOT_PHP_EX);
117
+require_once(SN_ROOT_PHYSICAL."includes/vars/vars".DOT_PHP_EX);
118
+require_once(SN_ROOT_PHYSICAL."includes/general".DOT_PHP_EX);
119 119
 
120 120
 init_update();
121 121
 
@@ -124,28 +124,28 @@  discard block
 block discarded – undo
124 124
   ? trim(strip_tags($_GET['page']))
125 125
   : str_replace(DOT_PHP_EX, '', str_replace(SN_ROOT_RELATIVE, '', str_replace('\\', '/', $_SERVER['SCRIPT_NAME'])));
126 126
 define('INITIAL_PAGE', $sn_page_name_original);
127
-define('SN_COOKIE', (classSupernova::$config->COOKIE_NAME ? classSupernova::$config->COOKIE_NAME : 'SuperNova') . (defined('SN_GOOGLE') ? '_G' : ''));
128
-define('SN_COOKIE_I', SN_COOKIE . AUTH_COOKIE_IMPERSONATE_SUFFIX);
129
-define('SN_COOKIE_D', SN_COOKIE . '_D');
130
-define('SN_COOKIE_T', SN_COOKIE . '_T'); // Time measure cookie
131
-define('SN_COOKIE_F', SN_COOKIE . '_F'); // Font size cookie
132
-define('SN_COOKIE_U', SN_COOKIE . '_U'); // Current user cookie aka user ID
133
-define('SN_COOKIE_U_I', SN_COOKIE_U . AUTH_COOKIE_IMPERSONATE_SUFFIX); // Current impersonator user cookie aka impersonator user ID
127
+define('SN_COOKIE', (classSupernova::$config->COOKIE_NAME ? classSupernova::$config->COOKIE_NAME : 'SuperNova').(defined('SN_GOOGLE') ? '_G' : ''));
128
+define('SN_COOKIE_I', SN_COOKIE.AUTH_COOKIE_IMPERSONATE_SUFFIX);
129
+define('SN_COOKIE_D', SN_COOKIE.'_D');
130
+define('SN_COOKIE_T', SN_COOKIE.'_T'); // Time measure cookie
131
+define('SN_COOKIE_F', SN_COOKIE.'_F'); // Font size cookie
132
+define('SN_COOKIE_U', SN_COOKIE.'_U'); // Current user cookie aka user ID
133
+define('SN_COOKIE_U_I', SN_COOKIE_U.AUTH_COOKIE_IMPERSONATE_SUFFIX); // Current impersonator user cookie aka impersonator user ID
134 134
 define('TEMPLATE_NAME', classSupernova::$config->game_default_template ? classSupernova::$config->game_default_template : 'OpenGame');
135
-define('TEMPLATE_PATH', 'design/templates/' . TEMPLATE_NAME);
136
-define('TEMPLATE_DIR', SN_ROOT_PHYSICAL . TEMPLATE_PATH);
135
+define('TEMPLATE_PATH', 'design/templates/'.TEMPLATE_NAME);
136
+define('TEMPLATE_DIR', SN_ROOT_PHYSICAL.TEMPLATE_PATH);
137 137
 define('DEFAULT_SKINPATH', classSupernova::$config->game_default_skin ? classSupernova::$config->game_default_skin : 'skins/EpicBlue/');
138 138
 define('DEFAULT_LANG', classSupernova::$config->game_default_language ? classSupernova::$config->game_default_language : 'ru');
139 139
 define('FMT_DATE', classSupernova::$config->int_format_date ? classSupernova::$config->int_format_date : 'd.m.Y');
140 140
 define('FMT_TIME', classSupernova::$config->int_format_time ? classSupernova::$config->int_format_time : 'H:i:s');
141
-define('FMT_DATE_TIME', FMT_DATE . ' ' . FMT_TIME);
141
+define('FMT_DATE_TIME', FMT_DATE.' '.FMT_TIME);
142 142
 
143 143
 $HTTP_ACCEPT_LANGUAGE = DEFAULT_LANG;
144 144
 
145
-require_once(SN_ROOT_PHYSICAL . "includes/template" . DOT_PHP_EX);
145
+require_once(SN_ROOT_PHYSICAL."includes/template".DOT_PHP_EX);
146 146
 $template_result = array('.' => array('result' => array()));
147 147
 
148
-sn_sys_load_php_files(SN_ROOT_PHYSICAL . "includes/functions/", PHP_EX);
148
+sn_sys_load_php_files(SN_ROOT_PHYSICAL."includes/functions/", PHP_EX);
149 149
 
150 150
 
151 151
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 // Конфиг - часть манифеста?
158 158
 classSupernova::$auth = new core_auth();
159 159
 
160
-sn_sys_load_php_files(SN_ROOT_PHYSICAL . "modules/", PHP_EX, true);
160
+sn_sys_load_php_files(SN_ROOT_PHYSICAL."modules/", PHP_EX, true);
161 161
 // Здесь - потому что core_auth модуль лежит в другом каталоге и его нужно инициализировать отдельно
162 162
 
163 163
 // Подключаем дефолтную страницу
@@ -165,10 +165,10 @@  discard block
 block discarded – undo
165 165
 // Сейчас мы делаем это здесь только для того, что бы содержание дефолтной страницы оказалось вверху. Что не факт, что нужно всегда
166 166
 // Но нужно, пока у нас есть не MVC-страницы
167 167
 $sn_page_data = $sn_data['pages'][$sn_page_name];
168
-$sn_page_name_file = 'includes/pages/' . $sn_page_data['filename'] . DOT_PHP_EX;
169
-if($sn_page_name && isset($sn_page_data) && file_exists($sn_page_name_file)) {
168
+$sn_page_name_file = 'includes/pages/'.$sn_page_data['filename'].DOT_PHP_EX;
169
+if ($sn_page_name && isset($sn_page_data) && file_exists($sn_page_name_file)) {
170 170
   require_once($sn_page_name_file);
171
-  if(is_array($sn_page_data['options'])) {
171
+  if (is_array($sn_page_data['options'])) {
172 172
     classSupernova::$options = array_merge(classSupernova::$options, $sn_page_data['options']);
173 173
   }
174 174
 }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 
179 179
 
180 180
 // А теперь проверяем - поддерживают ли у нас загруженный код такую страницу
181
-if(!isset($sn_data['pages'][$sn_page_name])) {
181
+if (!isset($sn_data['pages'][$sn_page_name])) {
182 182
   $sn_page_name = '';
183 183
 }
184 184
 
@@ -186,6 +186,6 @@  discard block
 block discarded – undo
186 186
 classLocale::$lang = $lang = new classLocale(classSupernova::$config->server_locale_log_usage);
187 187
 classLocale::$lang->lng_switch(sys_get_param_str('lang'));
188 188
 
189
-if(!defined('DEBUG_INIT_SKIP_SECONDARY') || DEBUG_INIT_SKIP_SECONDARY !== true) {
189
+if (!defined('DEBUG_INIT_SKIP_SECONDARY') || DEBUG_INIT_SKIP_SECONDARY !== true) {
190 190
   require_once "init_secondary.php";
191 191
 }
Please login to merge, or discard this patch.
includes/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.
buddy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-include('common.' . substr(strrchr(__FILE__, '.'), 1));
3
+include('common.'.substr(strrchr(__FILE__, '.'), 1));
4 4
 
5 5
 $template = gettemplate('viewreport', true);
6 6
 $template->assign_var('PAGE_HINT', classLocale::$lang['cr_view_hint']);
Please login to merge, or discard this patch.
includes/classes/PropertyHider.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
76 76
 
77 77
   protected function checkPropertyExists($name) {
78 78
     if (!array_key_exists($name, $this->_properties)) {
79
-      throw new ExceptionPropertyNotExists('Property [' . get_called_class() . '::' . $name . '] not exists', ERR_ERROR);
79
+      throw new ExceptionPropertyNotExists('Property ['.get_called_class().'::'.$name.'] not exists', ERR_ERROR);
80 80
     }
81 81
   }
82 82
 
83 83
   protected function checkOverwriteAdjusted($name) {
84 84
     if (array_key_exists($name, $this->propertiesAdjusted)) {
85
-      throw new PropertyAccessException('Property [' . get_called_class() . '::' . $name . '] already was adjusted so no SET is possible until dbSave', ERR_ERROR);
85
+      throw new PropertyAccessException('Property ['.get_called_class().'::'.$name.'] already was adjusted so no SET is possible until dbSave', ERR_ERROR);
86 86
     }
87 87
   }
88 88
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
    * @return boolean
132 132
    */
133 133
   public function isContainerEmpty() {
134
-    throw new Exception('PropertyHider::isContainerEmpty() is not implemented. You should implement it in class ' . get_called_class());
134
+    throw new Exception('PropertyHider::isContainerEmpty() is not implemented. You should implement it in class '.get_called_class());
135 135
   }
136 136
 
137 137
 
@@ -175,15 +175,15 @@  discard block
 block discarded – undo
175 175
     $result = null;
176 176
     // Now deciding - will we call a protected setter or will we work with protected property
177 177
     // Todo - on init recalc all method_exists
178
-    if (method_exists($this, $methodName = $action . ucfirst($name))) {
178
+    if (method_exists($this, $methodName = $action.ucfirst($name))) {
179 179
       // If method exists - just calling it
180 180
       // TODO - should return TRUE if value changed or FALSE otherwise
181 181
       $result = call_user_func_array(array($this, $methodName), array($value));
182 182
     } elseif ($this->isPropertyActionAvailable($name, $action)) {
183 183
       // No setter exists - works directly with protected property
184
-      $result = $this->{$action . 'Property'}($name, $value);
184
+      $result = $this->{$action.'Property'}($name, $value);
185 185
     } else {
186
-      throw new ExceptionPropertyNotExists('Property [' . get_called_class() . '::' . $name . '] does not have ' . $action . 'ter/property to ' . $action, ERR_ERROR);
186
+      throw new ExceptionPropertyNotExists('Property ['.get_called_class().'::'.$name.'] does not have '.$action.'ter/property to '.$action, ERR_ERROR);
187 187
     }
188 188
 
189 189
     return $result;
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
    * @return string
275 275
    */
276 276
   protected function adjustPropertyString($name, $diff) {
277
-    return (string)$this->$name . (string)$diff;
277
+    return (string) $this->$name.(string) $diff;
278 278
   }
279 279
 
280 280
   /**
@@ -284,8 +284,8 @@  discard block
 block discarded – undo
284 284
    * @return array
285 285
    */
286 286
   protected function adjustPropertyArray($name, $diff) {
287
-    $copy = (array)$this->$name;
288
-    HelperArray::merge($copy, (array)$diff, HelperArray::MERGE_PHP);
287
+    $copy = (array) $this->$name;
288
+    HelperArray::merge($copy, (array) $diff, HelperArray::MERGE_PHP);
289 289
 
290 290
     return $copy;
291 291
   }
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
    * @return int
298 298
    */
299 299
   protected function deltaInteger($name, $diff) {
300
-    return (int)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0) + (int)$diff;
300
+    return (int) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0) + (int) $diff;
301 301
   }
302 302
 
303 303
   /**
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
    * @return float
308 308
    */
309 309
   protected function deltaDouble($name, $diff) {
310
-    return (float)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0.0) + (float)$diff;
310
+    return (float) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, 0.0) + (float) $diff;
311 311
   }
312 312
 
313 313
   /**
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
    * @return string
318 318
    */
319 319
   protected function deltaString($name, $diff) {
320
-    return (string)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, '') . (string)$diff;
320
+    return (string) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, '').(string) $diff;
321 321
   }
322 322
 
323 323
   /**
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
    * @return array
328 328
    */
329 329
   protected function deltaArray($name, $diff) {
330
-    $copy = (array)HelperArray::keyExistsOr($this->propertiesAdjusted, $name, array());
330
+    $copy = (array) HelperArray::keyExistsOr($this->propertiesAdjusted, $name, array());
331 331
     HelperArray::merge($copy, $diff, HelperArray::MERGE_PHP);
332 332
 
333 333
     return $copy;
@@ -350,10 +350,10 @@  discard block
 block discarded – undo
350 350
     // Capitalizing type name
351 351
     $methodName = explode(' ', $type);
352 352
     array_walk($methodName, 'DbSqlHelper::UCFirstByRef');
353
-    $methodName = $prefix . implode('', $methodName);
353
+    $methodName = $prefix.implode('', $methodName);
354 354
 
355 355
     if (!method_exists($this, $methodName)) {
356
-      throw new ExceptionTypeUnsupported('Type "' . $type . '" is unsupported in PropertyHider::propertyMethodResult');
356
+      throw new ExceptionTypeUnsupported('Type "'.$type.'" is unsupported in PropertyHider::propertyMethodResult');
357 357
     }
358 358
 
359 359
     return call_user_func(array($this, $methodName), $name, $diff);
Please login to merge, or discard this patch.
includes/classes/Common/Types.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
       break;
31 31
 
32 32
       case TYPE_ARRAY:
33
-        $value = (array)$value;
33
+        $value = (array) $value;
34 34
       break;
35 35
 
36 36
       case TYPE_STRING:
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
       case TYPE_EMPTY:
39 39
         // No-type defaults to string
40 40
       default:
41
-        $value = (string)$value;
41
+        $value = (string) $value;
42 42
       break;
43 43
     }
44 44
 
Please login to merge, or discard this patch.
includes/classes/V2PropertyContainer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     if (is_callable($callable)) {
53 53
       $this->accessors[$type][$varName] = $callable;
54 54
     } else {
55
-      throw new Exception('Error assigning callable in ' . get_called_class() . '! Callable typed [' . $type . '] is not a callable or not accessible in the scope');
55
+      throw new Exception('Error assigning callable in '.get_called_class().'! Callable typed ['.$type.'] is not a callable or not accessible in the scope');
56 56
     }
57 57
   }
58 58
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
   }
74 74
 
75 75
   public function importRow($row) {
76
-    if(empty($row)) {
76
+    if (empty($row)) {
77 77
       return;
78 78
     }
79 79
 
Please login to merge, or discard this patch.
includes/classes/V2Unit/V2UnitModel.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
     $that = $this;
79 79
 
80 80
     $this->_container->assignAccessor('type', P_CONTAINER_GETTER,
81
-      function () use ($that) {
81
+      function() use ($that) {
82 82
         return $that->type;
83 83
       }
84 84
     );
85 85
     $this->_container->assignAccessor('type', P_CONTAINER_SETTER,
86
-      function ($value) use ($that) {
86
+      function($value) use ($that) {
87 87
         $that->type = $value;
88 88
         $array = get_unit_param($value);
89 89
         $that->unitInfo = $array;
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     $propertyName = 'timeStart';
100 100
     $fieldName = self::$_properties[$propertyName][P_DB_FIELD];
101 101
     $this->_container->assignAccessor($propertyName, P_CONTAINER_IMPORTER,
102
-      function (&$row) use ($that, $fieldName) {
102
+      function(&$row) use ($that, $fieldName) {
103 103
         if (isset($row[$fieldName])) {
104 104
           $dateTime = new \DateTime($row[$fieldName]);
105 105
         } else {
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
       }
110 110
     );
111 111
     $this->_container->assignAccessor($propertyName, P_CONTAINER_EXPORTER,
112
-      function (&$row) use ($that, $fieldName) {
112
+      function(&$row) use ($that, $fieldName) {
113 113
         $dateTime = $that->timeStart;
114 114
         if ($dateTime instanceof \DateTime) {
115 115
           $row[$fieldName] = $dateTime->format(FMT_DATE_TIME_SQL);
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
     $propertyName = 'timeFinish';
123 123
     $fieldName = self::$_properties[$propertyName][P_DB_FIELD];
124 124
     $this->_container->assignAccessor($propertyName, P_CONTAINER_IMPORTER,
125
-      function (&$row) use ($that, $fieldName) {
125
+      function(&$row) use ($that, $fieldName) {
126 126
         if (isset($row[$fieldName])) {
127 127
           $dateTime = new \DateTime($row[$fieldName]);
128 128
         } else {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
       }
133 133
     );
134 134
     $this->_container->assignAccessor($propertyName, P_CONTAINER_EXPORTER,
135
-      function (&$row) use ($that, $fieldName) {
135
+      function(&$row) use ($that, $fieldName) {
136 136
         $dateTime = $that->timeFinish;
137 137
         if ($dateTime instanceof \DateTime) {
138 138
           $row[$fieldName] = $dateTime->format(FMT_DATE_TIME_SQL);
Please login to merge, or discard this patch.
includes/classes/Buddy/BuddyView.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,14 +27,14 @@
 block discarded – undo
27 27
     $cBuddy->new_request_text_unsafe = sys_get_param_str_unsafe('request_text');
28 28
     $cBuddy->playerArray = $user;
29 29
 
30
-    $cBuddy->playerId = function (BuddyRoutingParams $cBuddy) {
30
+    $cBuddy->playerId = function(BuddyRoutingParams $cBuddy) {
31 31
       return $cBuddy->playerArray['id'];
32 32
     };
33
-    $cBuddy->playerName = function (BuddyRoutingParams $cBuddy) {
33
+    $cBuddy->playerName = function(BuddyRoutingParams $cBuddy) {
34 34
       return $cBuddy->playerArray['username'];
35 35
     };
36
-    $cBuddy->playerNameAndCoordinates = function (BuddyRoutingParams $cBuddy) {
37
-      return "{$cBuddy->playerArray['username']} " . uni_render_coordinates($cBuddy->playerArray);
36
+    $cBuddy->playerNameAndCoordinates = function(BuddyRoutingParams $cBuddy) {
37
+      return "{$cBuddy->playerArray['username']} ".uni_render_coordinates($cBuddy->playerArray);
38 38
     };
39 39
 
40 40
     $result = array();
Please login to merge, or discard this patch.
includes/classes/classSupernova.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 use Vector\Vector;
4
-
5 4
 use Common\GlobalContainer;
6 5
 
7 6
 class classSupernova {
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
     ini_get('magic_quotes_sybase') ? die('SN is incompatible with \'magic_quotes_sybase\' turned on. Disable it in php.ini or .htaccess...') : false;
204 204
     if (@get_magic_quotes_gpc()) {
205 205
       $gpcr = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
206
-      array_walk_recursive($gpcr, function (&$value, $key) {
206
+      array_walk_recursive($gpcr, function(&$value, $key) {
207 207
         $value = stripslashes($value);
208 208
       });
209 209
     }
@@ -219,43 +219,43 @@  discard block
 block discarded – undo
219 219
     $gc = static::$gc;
220 220
 
221 221
     // Default db
222
-    $gc->db = function ($c) {
222
+    $gc->db = function($c) {
223 223
       $db = new db_mysql($c);
224 224
       $db->sn_db_connect();
225 225
 
226 226
       return $db;
227 227
     };
228 228
 
229
-    $gc->debug = function ($c) {
229
+    $gc->debug = function($c) {
230 230
       return new debug();
231 231
     };
232 232
 
233
-    $gc->cache = function ($c) {
233
+    $gc->cache = function($c) {
234 234
       return new classCache(classSupernova::$cache_prefix);
235 235
     };
236 236
 
237
-    $gc->config = function ($c) {
237
+    $gc->config = function($c) {
238 238
       return new classConfig(classSupernova::$cache_prefix);
239 239
     };
240 240
 
241
-    $gc->localePlayer = function (GlobalContainer $c) {
241
+    $gc->localePlayer = function(GlobalContainer $c) {
242 242
       return new classLocale($c->config->server_locale_log_usage);
243 243
     };
244 244
 
245
-    $gc->dbRowOperator = function ($c) {
245
+    $gc->dbRowOperator = function($c) {
246 246
       return new DbRowDirectOperator($c);
247 247
     };
248 248
 
249 249
     $gc->buddyClass = 'Buddy\BuddyModel';
250
-    $gc->buddy = $gc->factory(function (GlobalContainer $c) {
250
+    $gc->buddy = $gc->factory(function(GlobalContainer $c) {
251 251
       return new $c->buddyClass($c);
252 252
     });
253 253
 
254
-    $gc->query = $gc->factory(function (GlobalContainer $c) {
254
+    $gc->query = $gc->factory(function(GlobalContainer $c) {
255 255
       return new DbQueryConstructor($c->db);
256 256
     });
257 257
 
258
-    $gc->unit = $gc->factory(function (GlobalContainer $c) {
258
+    $gc->unit = $gc->factory(function(GlobalContainer $c) {
259 259
       return new \V2Unit\V2UnitModel($c);
260 260
     });
261 261
 
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
   public static function init_3_load_config_file() {
269 269
     $dbsettings = array();
270 270
 
271
-    require(SN_ROOT_PHYSICAL . "config" . DOT_PHP_EX);
271
+    require(SN_ROOT_PHYSICAL."config".DOT_PHP_EX);
272 272
     self::$cache_prefix = !empty($dbsettings['cache_prefix']) ? $dbsettings['cache_prefix'] : $dbsettings['prefix'];
273 273
     self::$db_name = $dbsettings['name'];
274 274
     self::$sn_secret_word = $dbsettings['secretword'];
Please login to merge, or discard this patch.