@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | define('SN_IN_FLEET', true); |
6 | 6 | define('SN_RENDER_NAVBAR_PLANET', true); |
7 | 7 | |
8 | -include('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
|
8 | +include('../common.'.substr(strrchr(__FILE__, '.'), 1)); |
|
9 | 9 | |
10 | 10 | // TODO - Переместить это куда-нибудь |
11 | 11 | $fleet_page = sys_get_param_int('fleet_page', sys_get_param_int('mode')); |
@@ -192,8 +192,8 @@ discard block |
||
192 | 192 | // break; |
193 | 193 | } |
194 | 194 | |
195 | - if($exceptionCode !== null) { |
|
196 | - print('<span style="color: red; font-size: 200%;">FAILED! Expected Exception [' . $exceptionCode . ']: "' . classLocale::$lang['fl_attack_error'][$exceptionCode] . '" - FAILED!</span><br />'); |
|
195 | + if ($exceptionCode !== null) { |
|
196 | + print('<span style="color: red; font-size: 200%;">FAILED! Expected Exception ['.$exceptionCode.']: "'.classLocale::$lang['fl_attack_error'][$exceptionCode].'" - FAILED!</span><br />'); |
|
197 | 197 | print('<div style="color: red; font-size: 200%;">NO EXCEPTION RAISED</div>'); |
198 | 198 | pdie(); |
199 | 199 | } else { |
@@ -203,8 +203,8 @@ discard block |
||
203 | 203 | if ($exceptionCode !== null && $e->getCode() === $exceptionCode) { |
204 | 204 | // print('<span style="color: darkgreen;">Exception [' . $exceptionCode . ']: "' . classLocale::$lang['fl_attack_error'][$exceptionCode] . '" - passed</span><br />'); |
205 | 205 | } else { |
206 | - print('<div style="color: red; font-size: 200%;">Expected Exception [' . $exceptionCode . ']: "' . classLocale::$lang['fl_attack_error'][$exceptionCode] . '" - FAILED!</div>'); |
|
207 | - print('<div style="color: red; font-size: 200%;">Got Exception [' . $e->getCode() . ']: "' . $e->getMessage() . '"/"' . classLocale::$lang['fl_attack_error'][$e->getCode()] . '" . "</div>'); |
|
206 | + print('<div style="color: red; font-size: 200%;">Expected Exception ['.$exceptionCode.']: "'.classLocale::$lang['fl_attack_error'][$exceptionCode].'" - FAILED!</div>'); |
|
207 | + print('<div style="color: red; font-size: 200%;">Got Exception ['.$e->getCode().']: "'.$e->getMessage().'"/"'.classLocale::$lang['fl_attack_error'][$e->getCode()].'" . "</div>'); |
|
208 | 208 | throw $e; |
209 | 209 | } |
210 | 210 | } |
@@ -228,7 +228,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -444,7 +444,6 @@ discard block |
||
444 | 444 | } |
445 | 445 | |
446 | 446 | /** |
447 | - * @param bool $skip_query_check |
|
448 | 447 | * |
449 | 448 | * @return array |
450 | 449 | */ |
@@ -455,7 +454,6 @@ discard block |
||
455 | 454 | } |
456 | 455 | |
457 | 456 | /** |
458 | - * @param bool $skip_query_check |
|
459 | 457 | * |
460 | 458 | * @return mixed|null |
461 | 459 | */ |
@@ -239,7 +239,7 @@ |
||
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 |
@@ -125,7 +125,7 @@ |
||
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 | } |
@@ -2,7 +2,7 @@ |
||
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 | /** |
@@ -1,6 +1,6 @@ |
||
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']); |
@@ -76,13 +76,13 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -30,7 +30,7 @@ discard block |
||
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 |
||
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 |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | use Vector\Vector; |
4 | - |
|
5 | 4 | use Common\GlobalContainer; |
6 | 5 | |
7 | 6 | class classSupernova { |
@@ -112,7 +112,7 @@ |
||
112 | 112 | public static function init_3_load_config_file() { |
113 | 113 | $dbsettings = array(); |
114 | 114 | |
115 | - require(SN_ROOT_PHYSICAL . "config" . DOT_PHP_EX); |
|
115 | + require(SN_ROOT_PHYSICAL."config".DOT_PHP_EX); |
|
116 | 116 | self::$cache_prefix = !empty($dbsettings['cache_prefix']) ? $dbsettings['cache_prefix'] : $dbsettings['prefix']; |
117 | 117 | self::$db_name = $dbsettings['name']; |
118 | 118 | self::$sn_secret_word = $dbsettings['secretword']; |