@@ -421,31 +421,31 @@ discard block |
||
421 | 421 | |
422 | 422 | return classSupernova::$db->doSelect( |
423 | 423 | // Блокировка самого флота |
424 | - "SELECT 1 FROM {{fleets}} AS f " . |
|
424 | + "SELECT 1 FROM {{fleets}} AS f ". |
|
425 | 425 | |
426 | 426 | // Блокировка всех юнитов, принадлежащих этому флоту |
427 | - "LEFT JOIN {{unit}} as unit ON unit.unit_location_type = " . static::$locationType . " AND unit.unit_location_id = f.fleet_id " . |
|
427 | + "LEFT JOIN {{unit}} as unit ON unit.unit_location_type = ".static::$locationType." AND unit.unit_location_id = f.fleet_id ". |
|
428 | 428 | |
429 | 429 | // Блокировка всех прилетающих и улетающих флотов, если нужно |
430 | 430 | // TODO - lock fleets by COORDINATES |
431 | - ($mission_data['dst_fleets'] ? "LEFT JOIN {{fleets}} AS fd ON fd.fleet_end_planet_id = f.fleet_end_planet_id OR fd.fleet_start_planet_id = f.fleet_end_planet_id " : '') . |
|
431 | + ($mission_data['dst_fleets'] ? "LEFT JOIN {{fleets}} AS fd ON fd.fleet_end_planet_id = f.fleet_end_planet_id OR fd.fleet_start_planet_id = f.fleet_end_planet_id " : ''). |
|
432 | 432 | // Блокировка всех юнитов, принадлежащих прилетающим и улетающим флотам - ufd = unit_fleet_destination |
433 | - ($mission_data['dst_fleets'] ? "LEFT JOIN {{unit}} AS ufd ON ufd.unit_location_type = " . static::$locationType . " AND ufd.unit_location_id = fd.fleet_id " : '') . |
|
433 | + ($mission_data['dst_fleets'] ? "LEFT JOIN {{unit}} AS ufd ON ufd.unit_location_type = ".static::$locationType." AND ufd.unit_location_id = fd.fleet_id " : ''). |
|
434 | 434 | |
435 | - ($mission_data['dst_user'] || $mission_data['dst_planet'] ? "LEFT JOIN {{users}} AS ud ON ud.id = f.fleet_target_owner " : '') . |
|
435 | + ($mission_data['dst_user'] || $mission_data['dst_planet'] ? "LEFT JOIN {{users}} AS ud ON ud.id = f.fleet_target_owner " : ''). |
|
436 | 436 | // Блокировка всех юнитов, принадлежащих владельцу планеты-цели |
437 | - ($mission_data['dst_user'] || $mission_data['dst_planet'] ? "LEFT JOIN {{unit}} AS unit_player_dest ON unit_player_dest.unit_player_id = ud.id " : '') . |
|
437 | + ($mission_data['dst_user'] || $mission_data['dst_planet'] ? "LEFT JOIN {{unit}} AS unit_player_dest ON unit_player_dest.unit_player_id = ud.id " : ''). |
|
438 | 438 | // Блокировка планеты-цели |
439 | - ($mission_data['dst_planet'] ? "LEFT JOIN {{planets}} AS pd ON pd.id = f.fleet_end_planet_id " : '') . |
|
439 | + ($mission_data['dst_planet'] ? "LEFT JOIN {{planets}} AS pd ON pd.id = f.fleet_end_planet_id " : ''). |
|
440 | 440 | // Блокировка всех юнитов, принадлежащих планете-цели - НЕ НУЖНО. Уже залочили ранее, как принадлежащие игроку-цели |
441 | 441 | // ($mission_data['dst_planet'] ? "LEFT JOIN {{unit}} AS upd ON upd.unit_location_type = " . LOC_PLANET . " AND upd.unit_location_id = pd.id " : '') . |
442 | 442 | |
443 | 443 | |
444 | - ($mission_data['src_user'] || $mission_data['src_planet'] ? "LEFT JOIN {{users}} AS us ON us.id = f.fleet_owner " : '') . |
|
444 | + ($mission_data['src_user'] || $mission_data['src_planet'] ? "LEFT JOIN {{users}} AS us ON us.id = f.fleet_owner " : ''). |
|
445 | 445 | // Блокировка всех юнитов, принадлежащих владельцу флота |
446 | - ($mission_data['src_user'] || $mission_data['src_planet'] ? "LEFT JOIN {{unit}} AS unit_player_src ON unit_player_src.unit_player_id = us.id " : '') . |
|
446 | + ($mission_data['src_user'] || $mission_data['src_planet'] ? "LEFT JOIN {{unit}} AS unit_player_src ON unit_player_src.unit_player_id = us.id " : ''). |
|
447 | 447 | // Блокировка планеты отправления |
448 | - ($mission_data['src_planet'] ? "LEFT JOIN {{planets}} AS ps ON ps.id = f.fleet_start_planet_id " : '') . |
|
448 | + ($mission_data['src_planet'] ? "LEFT JOIN {{planets}} AS ps ON ps.id = f.fleet_start_planet_id " : ''). |
|
449 | 449 | // Блокировка всех юнитов, принадлежащих планете с которой юниты были отправлены - НЕ НУЖНО. Уже залочили ранее, как принадлежащие владельцу флота |
450 | 450 | // ($mission_data['src_planet'] ? "LEFT JOIN {{unit}} AS ups ON ups.unit_location_type = " . LOC_PLANET . " AND ups.unit_location_id = ps.id " : '') . |
451 | 451 | |
@@ -462,11 +462,11 @@ discard block |
||
462 | 462 | public function dbGetLockById($dbId) { |
463 | 463 | classSupernova::$db->doSelect( |
464 | 464 | // Блокировка самого флота |
465 | - "SELECT 1 FROM {{fleets}} AS FLEET0 " . |
|
465 | + "SELECT 1 FROM {{fleets}} AS FLEET0 ". |
|
466 | 466 | // Lock fleet owner |
467 | - "LEFT JOIN {{users}} as USER0 on USER0.id = FLEET0.fleet_owner " . |
|
467 | + "LEFT JOIN {{users}} as USER0 on USER0.id = FLEET0.fleet_owner ". |
|
468 | 468 | // Блокировка всех юнитов, принадлежащих этому флоту |
469 | - "LEFT JOIN {{unit}} as UNIT0 ON UNIT0.unit_location_type = " . LOC_FLEET . " AND UNIT0.unit_location_id = FLEET0.fleet_id " . |
|
469 | + "LEFT JOIN {{unit}} as UNIT0 ON UNIT0.unit_location_type = ".LOC_FLEET." AND UNIT0.unit_location_id = FLEET0.fleet_id ". |
|
470 | 470 | |
471 | 471 | // Без предварительной выборки неизвестно - куда летит этот флот. |
472 | 472 | // Поэтому надо выбирать флоты, чьи координаты прибытия ИЛИ отбытия совпадают с координатами прибытия ИЛИ отбытия текущего флота. |
@@ -482,9 +482,9 @@ discard block |
||
482 | 482 | FLEET1.fleet_end_planet = FLEET0.fleet_end_planet |
483 | 483 | " . |
484 | 484 | // Блокировка всех юнитов, принадлежащих этим флотам |
485 | - "LEFT JOIN {{unit}} as UNIT1 ON UNIT1.unit_location_type = " . LOC_FLEET . " AND UNIT1.unit_location_id = FLEET1.fleet_id " . |
|
485 | + "LEFT JOIN {{unit}} as UNIT1 ON UNIT1.unit_location_type = ".LOC_FLEET." AND UNIT1.unit_location_id = FLEET1.fleet_id ". |
|
486 | 486 | // Lock fleet owner |
487 | - "LEFT JOIN {{users}} as USER1 on USER1.id = FLEET1.fleet_owner " . |
|
487 | + "LEFT JOIN {{users}} as USER1 on USER1.id = FLEET1.fleet_owner ". |
|
488 | 488 | |
489 | 489 | "LEFT JOIN {{fleets}} AS FLEET2 ON |
490 | 490 | FLEET2.fleet_mess = 1 AND FLEET0.fleet_mess = 0 AND |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | " . |
495 | 495 | // Блокировка всех юнитов, принадлежащих этим флотам |
496 | 496 | "LEFT JOIN {{unit}} as UNIT2 ON |
497 | - UNIT2.unit_location_type = " . LOC_FLEET . " AND |
|
497 | + UNIT2.unit_location_type = " . LOC_FLEET." AND |
|
498 | 498 | UNIT2.unit_location_id = FLEET2.fleet_id |
499 | 499 | " . |
500 | 500 | // Lock fleet owner |
@@ -511,11 +511,11 @@ discard block |
||
511 | 511 | " . |
512 | 512 | // Блокировка всех юнитов, принадлежащих этим флотам |
513 | 513 | "LEFT JOIN {{unit}} as UNIT3 ON |
514 | - UNIT3.unit_location_type = " . LOC_FLEET . " AND |
|
514 | + UNIT3.unit_location_type = " . LOC_FLEET." AND |
|
515 | 515 | UNIT3.unit_location_id = FLEET3.fleet_id |
516 | 516 | " . |
517 | 517 | // Lock fleet owner |
518 | - "LEFT JOIN {{users}} as USER3 on USER3.id = FLEET3.fleet_owner " . |
|
518 | + "LEFT JOIN {{users}} as USER3 on USER3.id = FLEET3.fleet_owner ". |
|
519 | 519 | |
520 | 520 | "LEFT JOIN {{fleets}} AS FLEET4 ON |
521 | 521 | FLEET4.fleet_mess = 1 AND FLEET0.fleet_mess = 1 AND |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | " . |
526 | 526 | // Блокировка всех юнитов, принадлежащих этим флотам |
527 | 527 | "LEFT JOIN {{unit}} as UNIT4 ON |
528 | - UNIT4.unit_location_type = " . LOC_FLEET . " AND |
|
528 | + UNIT4.unit_location_type = " . LOC_FLEET." AND |
|
529 | 529 | UNIT4.unit_location_id = FLEET4.fleet_id |
530 | 530 | " . |
531 | 531 | // Lock fleet owner |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | " . |
548 | 548 | // Блокировка всех юнитов, принадлежащих этой планете |
549 | 549 | "LEFT JOIN {{unit}} as UNIT5 ON |
550 | - UNIT5.unit_location_type = " . LOC_PLANET . " AND |
|
550 | + UNIT5.unit_location_type = " . LOC_PLANET." AND |
|
551 | 551 | UNIT5.unit_location_id = PLANETS5.id |
552 | 552 | " . |
553 | 553 | |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | " . |
566 | 566 | // Блокировка всех юнитов, принадлежащих этой планете |
567 | 567 | "LEFT JOIN {{unit}} as UNIT6 ON |
568 | - UNIT6.unit_location_type = " . LOC_PLANET . " AND |
|
568 | + UNIT6.unit_location_type = " . LOC_PLANET." AND |
|
569 | 569 | UNIT6.unit_location_id = PLANETS6.id |
570 | 570 | " . |
571 | 571 | "WHERE FLEET0.fleet_id = {$dbId} GROUP BY 1 FOR UPDATE" |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | } elseif ($this->isResource($unit_id)) { |
685 | 685 | $this->resource_list[$unit_id] = $unit_count; |
686 | 686 | } else { |
687 | - throw new Exception('Trying to pass to fleet non-resource and non-ship ' . var_export($unit_array, true), FLIGHT_SHIPS_UNIT_WRONG); |
|
687 | + throw new Exception('Trying to pass to fleet non-resource and non-ship '.var_export($unit_array, true), FLIGHT_SHIPS_UNIT_WRONG); |
|
688 | 688 | } |
689 | 689 | } |
690 | 690 | } |
@@ -818,7 +818,7 @@ discard block |
||
818 | 818 | * @param int $unit_count |
819 | 819 | */ |
820 | 820 | public function shipSetCount($unit_id, $unit_count = 0) { |
821 | - pdump(__CLASS__ . '->' . __FUNCTION__); |
|
821 | + pdump(__CLASS__.'->'.__FUNCTION__); |
|
822 | 822 | $this->shipAdjustCount($unit_id, $unit_count, true); |
823 | 823 | } |
824 | 824 | |
@@ -1016,7 +1016,7 @@ discard block |
||
1016 | 1016 | */ |
1017 | 1017 | public function resourcesSet($resource_list) { |
1018 | 1018 | if (!empty($this->propertiesAdjusted['resource_list'])) { |
1019 | - throw new ExceptionPropertyAccess('Property "resource_list" already was adjusted so no SET is possible until dbSave in ' . get_called_class() . '::unitSetResourceList', ERR_ERROR); |
|
1019 | + throw new ExceptionPropertyAccess('Property "resource_list" already was adjusted so no SET is possible until dbSave in '.get_called_class().'::unitSetResourceList', ERR_ERROR); |
|
1020 | 1020 | } |
1021 | 1021 | $this->resourcesAdjust($resource_list, true); |
1022 | 1022 | } |
@@ -1050,7 +1050,7 @@ discard block |
||
1050 | 1050 | // Check for negative unit value |
1051 | 1051 | if ($this->resource_list[$resource_id] < 0) { |
1052 | 1052 | // TODO |
1053 | - throw new Exception('Resource ' . $resource_id . ' will become negative in ' . get_called_class() . '::unitAdjustResourceList', ERR_ERROR); |
|
1053 | + throw new Exception('Resource '.$resource_id.' will become negative in '.get_called_class().'::unitAdjustResourceList', ERR_ERROR); |
|
1054 | 1054 | } |
1055 | 1055 | } |
1056 | 1056 | } |
@@ -1237,7 +1237,7 @@ discard block |
||
1237 | 1237 | |
1238 | 1238 | protected function printErrorIfNoShips() { |
1239 | 1239 | if ($this->unitList->unitsCount() <= 0) { |
1240 | - message(classLocale::$lang['fl_err_no_ships'], classLocale::$lang['fl_error'], 'fleet' . DOT_PHP_EX, 5); |
|
1240 | + message(classLocale::$lang['fl_err_no_ships'], classLocale::$lang['fl_error'], 'fleet'.DOT_PHP_EX, 5); |
|
1241 | 1241 | } |
1242 | 1242 | } |
1243 | 1243 | |
@@ -1625,14 +1625,14 @@ discard block |
||
1625 | 1625 | if (FLIGHT_ALLOWED == $validateResult[$missionType]) { |
1626 | 1626 | $this->allowed_missions[$missionType] = $mission; |
1627 | 1627 | } else { |
1628 | - if($missionType == $this->mission_type) { |
|
1628 | + if ($missionType == $this->mission_type) { |
|
1629 | 1629 | } |
1630 | 1630 | unset($this->allowed_missions[$missionType]); |
1631 | 1631 | } |
1632 | 1632 | } |
1633 | 1633 | |
1634 | - if(empty($this->allowed_missions)) { |
|
1635 | - if($this->mission_type != MT_NONE && isset($validateResult[$this->mission_type])) { |
|
1634 | + if (empty($this->allowed_missions)) { |
|
1635 | + if ($this->mission_type != MT_NONE && isset($validateResult[$this->mission_type])) { |
|
1636 | 1636 | throw new ExceptionFleetInvalid($validateResult[$this->mission_type], $validateResult[$this->mission_type]); |
1637 | 1637 | } else { |
1638 | 1638 | throw new ExceptionFleetInvalid(FLIGHT_MISSION_IMPOSSIBLE, FLIGHT_MISSION_IMPOSSIBLE); |
@@ -1864,7 +1864,7 @@ discard block |
||
1864 | 1864 | $template_result['.']['fleets'][] = $this->renderFleet(SN_TIME_NOW, $timeMissionJob); |
1865 | 1865 | |
1866 | 1866 | $template_result += array( |
1867 | - 'mission' => classLocale::$lang['type_mission'][$this->_mission_type] . ($this->_mission_type == MT_EXPLORE || $this->_mission_type == MT_HOLD ? ' ' . pretty_time($timeMissionJob) : ''), |
|
1867 | + 'mission' => classLocale::$lang['type_mission'][$this->_mission_type].($this->_mission_type == MT_EXPLORE || $this->_mission_type == MT_HOLD ? ' '.pretty_time($timeMissionJob) : ''), |
|
1868 | 1868 | 'dist' => pretty_number($this->travelData['distance']), |
1869 | 1869 | 'speed' => pretty_number($this->travelData['fleet_speed']), |
1870 | 1870 | 'deute_need' => pretty_number($this->travelData['consumption']), |
@@ -999,7 +999,7 @@ discard block |
||
999 | 999 | /** |
1000 | 1000 | * Set current resource list from array of units |
1001 | 1001 | * |
1002 | - * @param array $resource_list |
|
1002 | + * @param integer[] $resource_list |
|
1003 | 1003 | */ |
1004 | 1004 | public function resourcesSet($resource_list) { |
1005 | 1005 | if (!empty($this->propertiesAdjusted['resource_list'])) { |
@@ -1047,7 +1047,7 @@ discard block |
||
1047 | 1047 | } |
1048 | 1048 | |
1049 | 1049 | /** |
1050 | - * @param array $rate |
|
1050 | + * @param integer[] $rate |
|
1051 | 1051 | * |
1052 | 1052 | * @return float |
1053 | 1053 | */ |
@@ -1078,8 +1078,6 @@ discard block |
||
1078 | 1078 | * Restores fleet or resources to planet |
1079 | 1079 | * |
1080 | 1080 | * @param bool $start |
1081 | - * @param bool $only_resources |
|
1082 | - * @param int $result |
|
1083 | 1081 | */ |
1084 | 1082 | public function resourcesUnload($start = true) { |
1085 | 1083 | sn_db_transaction_check(true); |
@@ -1243,6 +1241,9 @@ discard block |
||
1243 | 1241 | } |
1244 | 1242 | |
1245 | 1243 | |
1244 | + /** |
|
1245 | + * @param integer $missionStartTimeStamp |
|
1246 | + */ |
|
1246 | 1247 | protected function renderFleetCoordinates($missionStartTimeStamp = SN_TIME_NOW, $timeMissionJob = 0) { |
1247 | 1248 | $timeToReturn = $this->travelData['duration'] * 2 + $timeMissionJob; |
1248 | 1249 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | // OK 4.9 |
37 | 37 | public function __construct($filename = __FILE__) { |
38 | - if($this->provider_id == ACCOUNT_PROVIDER_NONE) { |
|
38 | + if ($this->provider_id == ACCOUNT_PROVIDER_NONE) { |
|
39 | 39 | die('У всех провайдеров должен быть $provider_id!'); |
40 | 40 | } |
41 | 41 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | // OK 4.6 |
134 | 134 | public function player_name_suggest() { |
135 | 135 | $name = ''; |
136 | - if(is_object($this->account) && !empty($this->account->account_email)) { |
|
136 | + if (is_object($this->account) && !empty($this->account->account_email)) { |
|
137 | 137 | list($name) = explode('@', $this->account->account_email); |
138 | 138 | } |
139 | 139 |
@@ -228,8 +228,8 @@ discard block |
||
228 | 228 | * @return int|mixed |
229 | 229 | */ |
230 | 230 | public function calcColonyMaxCount($astrotech = -1) { |
231 | - if($astrotech == -1) { |
|
232 | - if(!isset($this->_dbRow[UNIT_PLAYER_COLONIES_MAX])) { |
|
231 | + if ($astrotech == -1) { |
|
232 | + if (!isset($this->_dbRow[UNIT_PLAYER_COLONIES_MAX])) { |
|
233 | 233 | |
234 | 234 | $expeditions = get_player_max_expeditons($this->_dbRow); |
235 | 235 | $astrotech = mrc_get_level($this->_dbRow, null, TECH_ASTROTECH); |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | |
303 | 303 | |
304 | 304 | public function expeditionsMax() { |
305 | - if($this->expeditionsMax === null) { |
|
305 | + if ($this->expeditionsMax === null) { |
|
306 | 306 | $this->expeditionsMax = get_player_max_expeditons($this->_dbRow); |
307 | 307 | } |
308 | 308 | |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | } |
311 | 311 | |
312 | 312 | public function expeditionsFlying() { |
313 | - if($this->expeditionsFlying === null) { |
|
313 | + if ($this->expeditionsFlying === null) { |
|
314 | 314 | $this->expeditionsFlying = FleetList::fleet_count_flying($this->_dbId, MT_EXPLORE); |
315 | 315 | } |
316 | 316 | |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | |
320 | 320 | |
321 | 321 | public function fleetsMax() { |
322 | - if($this->fleetMax === null) { |
|
322 | + if ($this->fleetMax === null) { |
|
323 | 323 | $this->fleetMax = GetMaxFleets($this->_dbRow); |
324 | 324 | } |
325 | 325 | |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | } |
328 | 328 | |
329 | 329 | public function fleetsFlying() { |
330 | - if($this->fleetFlying === null) { |
|
330 | + if ($this->fleetFlying === null) { |
|
331 | 331 | $this->fleetFlying = FleetList::fleet_count_flying($this->_dbId); |
332 | 332 | } |
333 | 333 | |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | |
337 | 337 | |
338 | 338 | public function coloniesMax() { |
339 | - if($this->coloniesMax === null) { |
|
339 | + if ($this->coloniesMax === null) { |
|
340 | 340 | $this->coloniesMax = get_player_max_colonies($this->_dbRow); |
341 | 341 | } |
342 | 342 | |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | } |
345 | 345 | |
346 | 346 | public function coloniesCurrent() { |
347 | - if($this->coloniesCurrent === null) { |
|
347 | + if ($this->coloniesCurrent === null) { |
|
348 | 348 | $this->coloniesCurrent = get_player_current_colonies($this->_dbRow); |
349 | 349 | } |
350 | 350 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | protected static $is_init = false; |
20 | 20 | |
21 | 21 | protected static function init() { |
22 | - if(!empty(static::$db)) { |
|
22 | + if (!empty(static::$db)) { |
|
23 | 23 | return; |
24 | 24 | } |
25 | 25 | static::$db = classSupernova::$db; |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | $provider_id_safe = intval($provider_id_unsafe); |
67 | 67 | !is_array($account_list) ? $account_list = array($account_list) : false; |
68 | 68 | |
69 | - foreach($account_list as $provider_account_id_unsafe) { |
|
69 | + foreach ($account_list as $provider_account_id_unsafe) { |
|
70 | 70 | $provider_account_id_safe = intval($provider_account_id_unsafe); |
71 | 71 | |
72 | 72 | // TODO - Здесь могут отсутствовать аккаунты - проверять провайдером |
73 | 73 | $query = static::$db->doquery("SELECT `user_id` FROM {{account_translate}} WHERE `provider_id` = {$provider_id_safe} AND `provider_account_id` = {$provider_account_id_safe} FOR UPDATE"); |
74 | - while($row = static::$db->db_fetch($query)) { |
|
74 | + while ($row = static::$db->db_fetch($query)) { |
|
75 | 75 | $account_translation[$row['user_id']][$provider_id_unsafe][$provider_account_id_unsafe] = true; |
76 | 76 | } |
77 | 77 | } |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | $account_translation = array(); |
89 | 89 | |
90 | 90 | $query = static::$db->doquery( |
91 | - "SELECT * FROM {{account_translate}} WHERE `user_id` = {$user_id_safe} " . |
|
92 | - ($provider_id_unsafe ? "AND `provider_id` = {$provider_id_safe} " : '') . |
|
91 | + "SELECT * FROM {{account_translate}} WHERE `user_id` = {$user_id_safe} ". |
|
92 | + ($provider_id_unsafe ? "AND `provider_id` = {$provider_id_safe} " : ''). |
|
93 | 93 | "ORDER BY `timestamp` FOR UPDATE"); |
94 | - while($row = static::$db->db_fetch($query)) { |
|
94 | + while ($row = static::$db->db_fetch($query)) { |
|
95 | 95 | $account_translation[$row['user_id']][$row['provider_id']][$row['provider_account_id']] = $row; |
96 | 96 | } |
97 | 97 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @return bool |
39 | 39 | */ |
40 | 40 | public function isEmpty() { |
41 | - throw new \Exception(get_class() . '::isEmpty() not implemented - inherited from ContainerPlus'); |
|
41 | + throw new \Exception(get_class().'::isEmpty() not implemented - inherited from ContainerPlus'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @return mixed |
48 | 48 | */ |
49 | 49 | public function clear() { |
50 | - throw new \Exception(get_class() . '::clear() not implemented - inherited from ContainerPlus'); |
|
50 | + throw new \Exception(get_class().'::clear() not implemented - inherited from ContainerPlus'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | public function castAs($type, $value) { |
14 | 14 | // TODO: Here should be some conversions to property type |
15 | - switch($type) { |
|
15 | + switch ($type) { |
|
16 | 16 | case TYPE_INTEGER: |
17 | 17 | $value = intval($value); |
18 | 18 | break; |
@@ -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 |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @param db_mysql|null $db |
87 | 87 | */ |
88 | 88 | public static function setDb($db = null) { |
89 | - if(empty($db) || !($db instanceof db_mysql)) { |
|
89 | + if (empty($db) || !($db instanceof db_mysql)) { |
|
90 | 90 | $db = null; |
91 | 91 | } |
92 | 92 | static::$db = !empty($db) || !class_exists('classSupernova', false) ? $db : classSupernova::$db; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | public function dbLoad($dbId, $lockSkip = false) { |
150 | 150 | $dbId = idval($dbId); |
151 | 151 | if ($dbId <= 0) { |
152 | - classSupernova::$debug->error(get_called_class() . '::' . __METHOD__ . ' $dbId not positive = ' . $dbId); |
|
152 | + classSupernova::$debug->error(get_called_class().'::'.__METHOD__.' $dbId not positive = '.$dbId); |
|
153 | 153 | |
154 | 154 | return; |
155 | 155 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $this->dbGetLockById($this->_dbId); |
162 | 162 | } |
163 | 163 | |
164 | - $db_row = classSupernova::$db->doSelectFetch("SELECT * FROM `{{" . static::$_table . "}}` WHERE `" . static::$_dbIdFieldName . "` = " . $this->_dbId . " LIMIT 1 FOR UPDATE;"); |
|
164 | + $db_row = classSupernova::$db->doSelectFetch("SELECT * FROM `{{".static::$_table."}}` WHERE `".static::$_dbIdFieldName."` = ".$this->_dbId." LIMIT 1 FOR UPDATE;"); |
|
165 | 165 | if (empty($db_row)) { |
166 | 166 | return; |
167 | 167 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | if ($this->isNew()) { |
194 | 194 | // No DB_ID - new unit |
195 | 195 | if ($this->isEmpty()) { |
196 | - classSupernova::$debug->error(__FILE__ . ':' . __LINE__ . ' - object is empty on ' . get_called_class() . '::dbSave'); |
|
196 | + classSupernova::$debug->error(__FILE__.':'.__LINE__.' - object is empty on '.get_called_class().'::dbSave'); |
|
197 | 197 | } |
198 | 198 | $this->dbInsert(); |
199 | 199 | } else { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $this->dbDelete(); |
203 | 203 | } else { |
204 | 204 | if (!sn_db_transaction_check(false)) { |
205 | - classSupernova::$debug->error(__FILE__ . ':' . __LINE__ . ' - transaction should always be started on ' . get_called_class() . '::dbUpdate'); |
|
205 | + classSupernova::$debug->error(__FILE__.':'.__LINE__.' - transaction should always be started on '.get_called_class().'::dbUpdate'); |
|
206 | 206 | } |
207 | 207 | $this->dbUpdate(); |
208 | 208 | } |
@@ -230,13 +230,13 @@ discard block |
||
230 | 230 | // TODO - protected |
231 | 231 | public function dbInsert() { |
232 | 232 | if (!$this->isNew()) { |
233 | - classSupernova::$debug->error(__FILE__ . ':' . __LINE__ . ' - record db_id is not empty on ' . get_called_class() . '::dbInsert'); |
|
233 | + classSupernova::$debug->error(__FILE__.':'.__LINE__.' - record db_id is not empty on '.get_called_class().'::dbInsert'); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | $fieldSet = $this->dbMakeFieldSet(false); |
237 | 237 | |
238 | 238 | if (!static::$db->doInsertSet(static::$_table, $fieldSet)) { |
239 | - classSupernova::$debug->error(__FILE__ . ':' . __LINE__ . ' - error saving record ' . get_called_class() . '::dbInsert'); |
|
239 | + classSupernova::$debug->error(__FILE__.':'.__LINE__.' - error saving record '.get_called_class().'::dbInsert'); |
|
240 | 240 | } |
241 | 241 | $this->_dbId = static::$db->db_insert_id(); |
242 | 242 | |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | public function dbUpdate() { |
251 | 251 | // TODO - Update |
252 | 252 | if ($this->isNew()) { |
253 | - classSupernova::$debug->error(__FILE__ . ':' . __LINE__ . ' - unit db_id is empty on dbUpdate'); |
|
253 | + classSupernova::$debug->error(__FILE__.':'.__LINE__.' - unit db_id is empty on dbUpdate'); |
|
254 | 254 | } |
255 | 255 | $this->db_field_update($this->dbMakeFieldUpdate()); |
256 | 256 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | // TODO - protected |
262 | 262 | public function dbDelete() { |
263 | 263 | if ($this->isNew()) { |
264 | - classSupernova::$debug->error(__FILE__ . ':' . __LINE__ . ' - unit db_id is empty on dbDelete'); |
|
264 | + classSupernova::$debug->error(__FILE__.':'.__LINE__.' - unit db_id is empty on dbDelete'); |
|
265 | 265 | } |
266 | 266 | classSupernova::$gc->db->doDeleteRowWhere(static::$_table, array(static::$_dbIdFieldName => $this->_dbId)); |
267 | 267 | $this->_dbId = 0; |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | } |
448 | 448 | } |
449 | 449 | |
450 | - if(empty($set)) { |
|
450 | + if (empty($set)) { |
|
451 | 451 | $theResult = true; |
452 | 452 | } else { |
453 | 453 | $theResult = classSupernova::$db->doUpdateRowAdjust( |
@@ -34,7 +34,7 @@ |
||
34 | 34 | * @throws ExceptionFleetInvalid |
35 | 35 | */ |
36 | 36 | public static function build($missionType, $fleet) { |
37 | - if (!empty(self::$missions[$missionType]) && class_exists($className = __NAMESPACE__ . '\\' . self::$missions[$missionType])) { |
|
37 | + if (!empty(self::$missions[$missionType]) && class_exists($className = __NAMESPACE__.'\\'.self::$missions[$missionType])) { |
|
38 | 38 | $result = new $className($fleet); |
39 | 39 | } else { |
40 | 40 | throw new ExceptionFleetInvalid("Mission type {$missionType} unknown", FLIGHT_MISSION_UNKNOWN); |
@@ -20,7 +20,7 @@ |
||
20 | 20 | * |
21 | 21 | * @package Buddy |
22 | 22 | */ |
23 | -class BuddyModel extends \Entity\KeyedModel{ |
|
23 | +class BuddyModel extends \Entity\KeyedModel { |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Name of table for this entity |