@@ -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 |
@@ -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 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @property string $playerName |
22 | 22 | * @property string $playerNameAndCoordinates |
23 | 23 | */ |
24 | -class BuddyParams extends ContainerPlus { |
|
24 | +class BuddyParams extends ContainerPlus { |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * BuddyParams constructor. |
@@ -39,14 +39,14 @@ discard block |
||
39 | 39 | |
40 | 40 | // $this->playerArray = $user; |
41 | 41 | |
42 | - $this->playerId = function (BuddyParams $cBuddy) { |
|
42 | + $this->playerId = function(BuddyParams $cBuddy) { |
|
43 | 43 | return $cBuddy->playerArray['id']; |
44 | 44 | }; |
45 | - $this->playerName = function (BuddyParams $cBuddy) { |
|
45 | + $this->playerName = function(BuddyParams $cBuddy) { |
|
46 | 46 | return $cBuddy->playerArray['username']; |
47 | 47 | }; |
48 | - $this->playerNameAndCoordinates = function (BuddyParams $cBuddy) { |
|
49 | - return "{$cBuddy->playerArray['username']} " . uni_render_coordinates($cBuddy->playerArray); |
|
48 | + $this->playerNameAndCoordinates = function(BuddyParams $cBuddy) { |
|
49 | + return "{$cBuddy->playerArray['username']} ".uni_render_coordinates($cBuddy->playerArray); |
|
50 | 50 | }; |
51 | 51 | } |
52 | 52 |
@@ -52,7 +52,7 @@ |
||
52 | 52 | !mysql_select_db($settings['name']) |
53 | 53 | ? classSupernova::$debug->error_fatal('DB error - cannot find DB on server', $this->mysql_error()) |
54 | 54 | : false; |
55 | - !$this->mysql_query('SET SESSION TRANSACTION ISOLATION LEVEL ' . self::DB_MYSQL_TRANSACTION_REPEATABLE_READ . ';') |
|
55 | + !$this->mysql_query('SET SESSION TRANSACTION ISOLATION LEVEL '.self::DB_MYSQL_TRANSACTION_REPEATABLE_READ.';') |
|
56 | 56 | ? classSupernova::$debug->error_fatal('DB error - cannot set desired isolation level', $this->mysql_error()) |
57 | 57 | : false; |
58 | 58 |
@@ -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 | /** |