Passed
Push — work-fleets ( 4e1f0c...91349a )
by SuperNova.WS
10:40
created
includes/includes/flt_mission_relocate.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 function flt_mission_relocate($mission_data) {
13 13
   $objFleet = $mission_data->fleet;
14 14
   $destination_planet = &$mission_data->dst_planet;
15
-  if($objFleet->playerOwnerId != $destination_planet['id_owner']) {
15
+  if ($objFleet->playerOwnerId != $destination_planet['id_owner']) {
16 16
     $objFleet->markReturnedAndSave();
17 17
 
18 18
     return;
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
       $fleet_resources[RES_METAL], classLocale::$lang['Metal'],
26 26
       $fleet_resources[RES_CRYSTAL], classLocale::$lang['Crystal'],
27 27
       $fleet_resources[RES_DEUTERIUM], classLocale::$lang['Deuterium']
28
-    ) . '<br />' . classLocale::$lang['sys_relocate_mess_user'];
29
-  foreach($objFleet->shipsIterator() as $ship_id => $ship) {
30
-    $Message .= classLocale::$lang['tech'][$ship_id] . ' - ' . $ship->count . '<br />';
28
+    ).'<br />'.classLocale::$lang['sys_relocate_mess_user'];
29
+  foreach ($objFleet->shipsIterator() as $ship_id => $ship) {
30
+    $Message .= classLocale::$lang['tech'][$ship_id].' - '.$ship->count.'<br />';
31 31
   }
32 32
   DBStaticMessages::msg_send_simple_message(
33 33
     $objFleet->playerOwnerId, '', $objFleet->time_arrive_to_target, MSG_TYPE_TRANSPORT, classLocale::$lang['sys_mess_qg'], classLocale::$lang['sys_stay_mess_stay'], $Message
Please login to merge, or discard this patch.
includes/constants.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
 define('FONT_SIZE_PERCENT_DEFAULT', 68.75);
66 66
 define('FONT_SIZE_PERCENT_MAX', 131.25);
67 67
 define('FONT_SIZE_PERCENT_STEP', 12.5);
68
-define('FONT_SIZE_PERCENT_DEFAULT_STRING', FONT_SIZE_PERCENT_DEFAULT . '%');
68
+define('FONT_SIZE_PERCENT_DEFAULT_STRING', FONT_SIZE_PERCENT_DEFAULT.'%');
69 69
 
70 70
 define('FONT_SIZE_PIXELS_BROWSER_BASE', 16);
71 71
 define('FONT_SIZE_PIXELS_MIN', 9);
72 72
 define('FONT_SIZE_PIXELS_DEFAULT', 11);
73 73
 define('FONT_SIZE_PIXELS_MAX', 21);
74 74
 define('FONT_SIZE_PIXELS_STEP', 1);
75
-define('FONT_SIZE_PIXELS_DEFAULT_STRING', FONT_SIZE_PIXELS_DEFAULT . 'px');
75
+define('FONT_SIZE_PIXELS_DEFAULT_STRING', FONT_SIZE_PIXELS_DEFAULT.'px');
76 76
 
77 77
 define('DEFAULT_PICTURE_EXTENSION_DOTTED', '.jpg');
78 78
 
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 define('SN_PAYMENT_REQUEST_OK', 0);
303 303
 define('SN_PAYMENT_REQUEST_ERROR_UNIT_AMOUNT', 1);
304 304
 define('SN_PAYMENT_REQUEST_ERROR_PAYLINK_UNSUPPORTED', 2);
305
-define('SN_PAYMENT_REQUEST_IP_WRONG', 3);  // Неправильный IP входящей системы - обычно хак
305
+define('SN_PAYMENT_REQUEST_IP_WRONG', 3); // Неправильный IP входящей системы - обычно хак
306 306
 define('SN_PAYMENT_REQUEST_COMMAND_UNSUPPORTED', 4); // Неподдерживаемая команда - обычно хак
307 307
 define('SN_PAYMENT_REQUEST_SIGNATURE_INVALID', 5); // Неправильная подпись или не сошлась контрольная сумма - обычно хак
308 308
 define('SN_MODULE_DISABLED', 6); // Модуль отключен // УНИВЕРСАЛЬНЫЙ ОТВЕТ!
@@ -772,14 +772,14 @@  discard block
 block discarded – undo
772 772
 
773 773
 
774 774
 // *** Mercenary/talent bonus types
775
-define('BONUS_NONE', 0);  // No bonus
776
-define('BONUS_PERCENT', 1);  // Percent on base value
777
-define('BONUS_ADD', 2);  // Add
778
-define('BONUS_ABILITY', 3);  // Some ability
779
-define('BONUS_MULTIPLY', 4);  // Multiply by value
780
-define('BONUS_PERCENT_CUMULATIVE', 5);  // Cumulative percent on base value
781
-define('BONUS_PERCENT_DEGRADED', 6);  // Bonus amount degraded with increase as pow(bonus, level) (?)
782
-define('BONUS_SPEED', 7);  // Speed bonus
775
+define('BONUS_NONE', 0); // No bonus
776
+define('BONUS_PERCENT', 1); // Percent on base value
777
+define('BONUS_ADD', 2); // Add
778
+define('BONUS_ABILITY', 3); // Some ability
779
+define('BONUS_MULTIPLY', 4); // Multiply by value
780
+define('BONUS_PERCENT_CUMULATIVE', 5); // Cumulative percent on base value
781
+define('BONUS_PERCENT_DEGRADED', 6); // Bonus amount degraded with increase as pow(bonus, level) (?)
782
+define('BONUS_SPEED', 7); // Speed bonus
783 783
 
784 784
 // *** Action constant (build should be replaced with ACTION)
785 785
 define('BUILD_CREATE', 1);
@@ -991,10 +991,10 @@  discard block
 block discarded – undo
991 991
 
992 992
 // === Artifacts
993 993
 define('UNIT_ARTIFACTS', 1000);
994
-define('ART_LHC', 1001);      // Additional moon chance
995
-define('ART_RCD_SMALL', 1002);   // Rapid Colony Deployment - Set of buildings up to 10th level - 10/14/ 3/0 -   405 DM
996
-define('ART_RCD_MEDIUM', 1003);  // Rapid Colony Deployment - Set of buildings up to 15th level - 15/20/ 8/0 -  4704 DM
997
-define('ART_RCD_LARGE', 1004);   // Rapid Colony Deployment - Set of buildings up to 20th level - 20/25/10/1 - 39790 DM
994
+define('ART_LHC', 1001); // Additional moon chance
995
+define('ART_RCD_SMALL', 1002); // Rapid Colony Deployment - Set of buildings up to 10th level - 10/14/ 3/0 -   405 DM
996
+define('ART_RCD_MEDIUM', 1003); // Rapid Colony Deployment - Set of buildings up to 15th level - 15/20/ 8/0 -  4704 DM
997
+define('ART_RCD_LARGE', 1004); // Rapid Colony Deployment - Set of buildings up to 20th level - 20/25/10/1 - 39790 DM
998 998
 define('ART_HEURISTIC_CHIP', 1005); // Speed up research
999 999
 define('ART_NANO_BUILDER', 1006); // Speed up building
1000 1000
 define('ART_NANO_CONSTRUCTOR', 1007); // RESERVED Speed up hangar constructions
@@ -1064,18 +1064,18 @@  discard block
 block discarded – undo
1064 1064
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE1', 2201); // Блиц-сервер, участник 0-го раунда, 1-е место
1065 1065
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE2', 2202); // Блиц-сервер, участник 0-го раунда, 2-е место
1066 1066
 define('UNIT_AWARD_MEDAL_BLITZ_R0_PLACE3', 2203); // Блиц-сервер, участник 0-го раунда, 3-е место
1067
-define('UNIT_AWARD_MEDAL_2016_WOMEN_DAY_BEST', 2204);  // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2016 года
1067
+define('UNIT_AWARD_MEDAL_2016_WOMEN_DAY_BEST', 2204); // Медаль Лучшему Кавалеру за максимум потраченной ММ/максимум одаренных женщин Женщине от Мужчины во время ивента 8 марта 2016 года
1068 1068
 
1069 1069
 define('UNIT_AWARD_MEMORY', 2300); // Памятные знаки за существование и участие - например "4 года в игре". "Был онлайн в новогоднюю ночь 2013". итд
1070
-define('UNIT_AWARD_MEMORY_IMMORTAL', 2301);  // Бессмертный
1071
-define('UNIT_AWARD_MEMORY_2015_WOMEN_DAY', 2302);  // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2015 года
1070
+define('UNIT_AWARD_MEMORY_IMMORTAL', 2301); // Бессмертный
1071
+define('UNIT_AWARD_MEMORY_2015_WOMEN_DAY', 2302); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2015 года
1072 1072
 define('UNIT_AWARD_MEMORY_BLITZ_R0', 2303); // Блиц-сервер, участник 0-го раунда
1073 1073
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_SIMPLE', 2304); // День Рождения СН
1074 1074
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_BRONZE', 2305); // День Рождения СН
1075 1075
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_SILVER', 2306); // День Рождения СН
1076 1076
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_GOLD', 2307); // День Рождения СН
1077 1077
 define('UNIT_AWARD_MEMORY_SUPER_BORN_2015_PLATINUM', 2308); // День Рождения СН
1078
-define('UNIT_AWARD_MEMORY_2016_WOMEN_DAY', 2309);  // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2016 года
1078
+define('UNIT_AWARD_MEMORY_2016_WOMEN_DAY', 2309); // Значек за подарок Женщине от Мужчины во время ивента 8 марта 2016 года
1079 1079
 
1080 1080
 define('UNIT_AWARD_PENNANT', 2400); // Переходящий вымпел - индикация статуса на сервере: "Топ-1", "Топ", "Сабтоп", "Самый большой флот" итд
1081 1081
 define('UNIT_AWARD_BADGE', 2600); // Бейджики/значки за ачивки - например, "Построил 1000 кораблей"
Please login to merge, or discard this patch.
classes/V2Fleet/V2FleetModel.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
   public function __construct(\Common\GlobalContainer $gc) {
94 94
     parent::__construct($gc);
95 95
 
96
-    $this->accessors->set(P_CONTAINER_SET, 'dbId', function (V2FleetContainer $that, $value) {
96
+    $this->accessors->set(P_CONTAINER_SET, 'dbId', function(V2FleetContainer $that, $value) {
97 97
       $that->setDirect('dbId', $value);
98 98
       $that->location->setLocationId($value);
99 99
     });
100 100
 
101
-    $this->accessors->set(P_CONTAINER_SET, 'ownerId', function (V2FleetContainer $that, $value) {
101
+    $this->accessors->set(P_CONTAINER_SET, 'ownerId', function(V2FleetContainer $that, $value) {
102 102
       $that->setDirect('ownerId', $value);
103 103
       $that->location->setLocationPlayerId($value);
104 104
     });
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     $this->accessors->set(P_CONTAINER_EXPORT, 'vectorArrive', array($this, 'exportVector'));
110 110
 
111 111
 
112
-    $this->accessors->set(P_CONTAINER_GET, 'location', function (V2FleetContainer $that) {
112
+    $this->accessors->set(P_CONTAINER_GET, 'location', function(V2FleetContainer $that) {
113 113
 //      if (is_null($location = $that->getDirect('location'))) {}
114 114
       $location = new V2Location(LOC_FLEET);
115 115
       $that->setDirect('location', $location);
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
       return $location;
118 118
     }, ACCESSOR_SHARED);
119 119
 
120
-    $this->accessors->set(P_CONTAINER_GET, 'units', function (V2FleetContainer $that) {
120
+    $this->accessors->set(P_CONTAINER_GET, 'units', function(V2FleetContainer $that) {
121 121
 //      if (is_null($units = $that->getDirect('units'))) {}
122 122
       $units = \classSupernova::$gc->unitList;
123 123
       $that->setDirect('units', $units);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
       return $units;
126 126
     }, ACCESSOR_SHARED);
127 127
 
128
-    $this->accessors->set(P_CONTAINER_GET, 'isReturning', function (V2FleetContainer $that) {
128
+    $this->accessors->set(P_CONTAINER_GET, 'isReturning', function(V2FleetContainer $that) {
129 129
       return $that->status == FLEET_FLAG_RETURNING;
130 130
     });
131 131
 
Please login to merge, or discard this patch.
classes/Common/Accessors.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
    * @return bool
41 41
    */
42 42
   public function exists($accessor, $varName) {
43
-    return isset($this->accessors[$accessor . $varName]);
43
+    return isset($this->accessors[$accessor.$varName]);
44 44
   }
45 45
 
46 46
   /**
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     if (empty($callable)) {
61 61
       return;
62 62
     } elseif (!is_callable($callable)) {
63
-      throw new \Exception('Error assigning callable in ' . get_called_class() . '::set()! Callable typed [' . $accessor . '] is not a callable or not accessible in the scope');
63
+      throw new \Exception('Error assigning callable in '.get_called_class().'::set()! Callable typed ['.$accessor.'] is not a callable or not accessible in the scope');
64 64
     }
65 65
 
66 66
     // Converting method array-callable to closure
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
 //      $method = new \ReflectionMethod($callable[0], $callable[1]);
71 71
 //      $callable = $method->getClosure($callable[0]);
72 72
 //    }
73
-    if(is_array($callable) && ($invoker = Invoker::build($callable))) {
73
+    if (is_array($callable) && ($invoker = Invoker::build($callable))) {
74 74
       $callable = $invoker;
75 75
     }
76 76
 
77
-    $functionName = $accessor . $varName;
77
+    $functionName = $accessor.$varName;
78 78
     $this->accessors[$functionName] = $callable;
79
-    if($shared == ACCESSOR_SHARED) {
79
+    if ($shared == ACCESSOR_SHARED) {
80 80
       $this->shared[$functionName] = true;
81 81
     }
82 82
   }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
    * @return callable|null
92 92
    */
93 93
   public function get($accessor, $varName) {
94
-    return $this->exists($accessor, $varName) ? $this->accessors[$accessor . $varName] : null;
94
+    return $this->exists($accessor, $varName) ? $this->accessors[$accessor.$varName] : null;
95 95
   }
96 96
 
97 97
   /**
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
    */
105 105
   public function execute($accessor, $varName, $params) {
106 106
     if (!$this->exists($accessor, $varName)) {
107
-      throw new \Exception("No [{$accessor}] accessor found for variable [{$varName}] on " . get_called_class() . "::" . __METHOD__);
107
+      throw new \Exception("No [{$accessor}] accessor found for variable [{$varName}] on ".get_called_class()."::".__METHOD__);
108 108
     }
109 109
 
110
-    $functionName = $accessor . $varName;
111
-    if(!isset($this->shared[$functionName]) || !array_key_exists($functionName, $this->executed)) {
110
+    $functionName = $accessor.$varName;
111
+    if (!isset($this->shared[$functionName]) || !array_key_exists($functionName, $this->executed)) {
112 112
       $this->executed[$functionName] = call_user_func_array($this->accessors[$functionName], $params);
113 113
     }
114 114
 
Please login to merge, or discard this patch.
classes/FleetList.php 2 patches
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -64,6 +64,10 @@  discard block
 block discarded – undo
64 64
    *
65 65
    */
66 66
   // DEPRECATED
67
+
68
+  /**
69
+   * @param boolean $for_update
70
+   */
67 71
   public static function dbGetFleetList($where_safe = '', $for_update = DB_SELECT_FOR_UPDATE) {
68 72
     $fleetList = new static();
69 73
     $fleetList->dbLoadWhere($where_safe, $for_update);
@@ -246,6 +250,7 @@  discard block
 block discarded – undo
246 250
    * LIST - Get missile attack list by condition
247 251
    *
248 252
    * @param string $where
253
+   * @param boolean $for_update
249 254
    */
250 255
   public function dbMergeMissileList($where, $for_update = DB_SELECT_FOR_UPDATE) {
251 256
     $query = classSupernova::$db->doSelect(
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -33,18 +33,18 @@  discard block
 block discarded – undo
33 33
     $fleets_added = array();
34 34
 
35 35
     $query = classSupernova::$db->doSelect(
36
-      "SELECT * FROM `{{fleets}}`" .
37
-      (!empty($where_safe) ? " WHERE {$where_safe}" : '') .
36
+      "SELECT * FROM `{{fleets}}`".
37
+      (!empty($where_safe) ? " WHERE {$where_safe}" : '').
38 38
       ($for_update == DB_SELECT_FOR_UPDATE ? " FOR UPDATE;" : '')
39 39
     );
40
-    while($row = db_fetch($query)) {
40
+    while ($row = db_fetch($query)) {
41 41
       /**
42 42
        * @var Fleet $fleet
43 43
        */
44 44
       $fleet = $this->_createElement();
45 45
       $fleet->dbRowParse($row);
46 46
 
47
-      if(isset($this[$fleet->dbId])) {
47
+      if (isset($this[$fleet->dbId])) {
48 48
         // Нужно ли ????
49 49
         classSupernova::$debug->error('Fleet list already set');
50 50
       }
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
   public static function dbGetFleetListCurrentTick() {
120 120
     return static::dbGetFleetList(
121 121
       "
122
-    (`fleet_start_time` <= " . SN_TIME_NOW . " AND `fleet_mess` = 0)
122
+    (`fleet_start_time` <= " . SN_TIME_NOW." AND `fleet_mess` = 0)
123 123
     OR
124
-    (`fleet_end_stay` <= " . SN_TIME_NOW . " AND `fleet_end_stay` > 0 AND `fleet_mess` = 0)
124
+    (`fleet_end_stay` <= " . SN_TIME_NOW." AND `fleet_end_stay` > 0 AND `fleet_mess` = 0)
125 125
     OR
126
-    (`fleet_end_time` <= " . SN_TIME_NOW . ")"
126
+    (`fleet_end_time` <= " . SN_TIME_NOW.")"
127 127
       , DB_SELECT_PLAIN
128 128
     );
129 129
   }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     AND `fleet_end_planet` = {$planet_row['planet']}
145 145
     AND `fleet_end_type`   = {$planet_row['planet_type']}
146 146
     AND `fleet_owner` = {$fleet_owner_id}
147
-    AND `fleet_mission` IN (" . MT_ATTACK . "," . MT_ACS . "," . MT_DESTROY . ")
147
+    AND `fleet_mission` IN (".MT_ATTACK.",".MT_ACS.",".MT_DESTROY.")
148 148
     AND `fleet_mess` = 0"
149 149
       , DB_SELECT_FOR_UPDATE
150 150
     );
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
    * @return static|array
171 171
    */
172 172
   public static function dbGetFleetListAndMissileByCoordinates($coordinates, $for_phalanx = false) {
173
-    if(empty($coordinates) || !is_array($coordinates)) {
173
+    if (empty($coordinates) || !is_array($coordinates)) {
174 174
       return array();
175 175
     }
176 176
 
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
      * @var Fleet[] $array_of_Fleet
202 202
      */
203 203
     $array_of_Fleet = array();
204
-    if(!empty($fleet_db_list) && $fleet_db_list->count()) {
205
-      foreach($fleet_db_list->_container as $fleet_id => $objFleet) {
204
+    if (!empty($fleet_db_list) && $fleet_db_list->count()) {
205
+      foreach ($fleet_db_list->_container as $fleet_id => $objFleet) {
206 206
         $array_of_Fleet[$fleet_id] = $objFleet;
207 207
       }
208 208
       $planet_fleets = flt_get_fleets_to_planet_by_array_of_Fleet($array_of_Fleet);
@@ -227,16 +227,16 @@  discard block
 block discarded – undo
227 227
     return static::dbGetFleetList(
228 228
       "(
229 229
       fleet_start_galaxy = {$galaxy}
230
-      AND fleet_start_system = {$system}" .
231
-      ($planet ? " AND fleet_start_planet = {$planet}" : '') .
232
-      ($planet_type != PT_ALL ? " AND fleet_start_type = {$planet_type}" : '') .
233
-      ($for_phalanx ? '' : " AND fleet_mess = 1") .
230
+      AND fleet_start_system = {$system}".
231
+      ($planet ? " AND fleet_start_planet = {$planet}" : '').
232
+      ($planet_type != PT_ALL ? " AND fleet_start_type = {$planet_type}" : '').
233
+      ($for_phalanx ? '' : " AND fleet_mess = 1").
234 234
       ") OR (
235 235
       fleet_end_galaxy = {$galaxy}
236
-      AND fleet_end_system = {$system}" .
237
-      ($planet ? " AND fleet_end_planet = {$planet}" : '') .
238
-      ($planet_type != PT_ALL ? " AND fleet_end_type = {$planet_type} " : '') .
239
-      ($for_phalanx ? '' : " AND fleet_mess = 0") .
236
+      AND fleet_end_system = {$system}".
237
+      ($planet ? " AND fleet_end_planet = {$planet}" : '').
238
+      ($planet_type != PT_ALL ? " AND fleet_end_type = {$planet_type} " : '').
239
+      ($for_phalanx ? '' : " AND fleet_mess = 0").
240 240
       ")"
241 241
       , DB_SELECT_PLAIN
242 242
     );
@@ -249,11 +249,11 @@  discard block
 block discarded – undo
249 249
    */
250 250
   public function dbMergeMissileList($where, $for_update = DB_SELECT_FOR_UPDATE) {
251 251
     $query = classSupernova::$db->doSelect(
252
-      "SELECT * FROM `{{iraks}}`" .
253
-      (!empty($where) ? " WHERE {$where}" : '') .
252
+      "SELECT * FROM `{{iraks}}`".
253
+      (!empty($where) ? " WHERE {$where}" : '').
254 254
       ($for_update == DB_SELECT_FOR_UPDATE ? " FOR UPDATE;" : '')
255 255
     );
256
-    while($missile_db_row = db_fetch($query)) {
256
+    while ($missile_db_row = db_fetch($query)) {
257 257
       /**
258 258
        * @var Fleet $objFleet
259 259
        */
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
    */
276 276
   public static function dbGetFleetListAndMissileINCOMING($owner_id) {
277 277
     $owner_id_safe = idval($owner_id);
278
-    if(empty($owner_id_safe)) {
278
+    if (empty($owner_id_safe)) {
279 279
       return array();
280 280
     }
281 281
 
@@ -309,10 +309,10 @@  discard block
 block discarded – undo
309 309
    */
310 310
   public static function fleet_count_flying($player_id, $mission_id = 0) {
311 311
     $player_id_safe = idval($player_id);
312
-    if(!empty($player_id_safe)) {
312
+    if (!empty($player_id_safe)) {
313 313
       $mission_id_safe = intval($mission_id);
314 314
       $result = static::db_fleet_count(
315
-        "`fleet_owner` = {$player_id_safe}" .
315
+        "`fleet_owner` = {$player_id_safe}".
316 316
         ($mission_id_safe ? " AND `fleet_mission` = {$mission_id_safe}" : '')
317 317
       );
318 318
     } else {
Please login to merge, or discard this patch.
classes/Entity/EntityModel.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     $this->rowOperator = $gc->dbGlobalRowOperator;
76 76
     $this->accessors = new Accessors();
77 77
 
78
-    if(property_exists($this, 'newProperties') && !empty($this->newProperties)) {
78
+    if (property_exists($this, 'newProperties') && !empty($this->newProperties)) {
79 79
       $this->extendProperties($this->newProperties);
80 80
     }
81 81
   }
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
   }
217 217
 
218 218
   protected function delete(EntityContainer $cEntity) {
219
-    throw new \Exception(__CLASS__ . '::delete() in ' . get_called_class() . 'is not yet implemented');
219
+    throw new \Exception(__CLASS__.'::delete() in '.get_called_class().'is not yet implemented');
220 220
   }
221 221
 
222 222
   protected function insert(EntityContainer $cEntity) {
@@ -229,19 +229,19 @@  discard block
 block discarded – undo
229 229
     // Generate changeset row
230 230
     // Foreach all rows. If there is change and no delta - then put delta. Otherwise put change
231 231
     // If row not empty - update
232
-    throw new \Exception(__CLASS__ . '::update() in ' . get_called_class() . 'is not yet implemented');
232
+    throw new \Exception(__CLASS__.'::update() in '.get_called_class().'is not yet implemented');
233 233
   }
234 234
 
235
-  protected function unchanged(EntityContainer $cEntity){
235
+  protected function unchanged(EntityContainer $cEntity) {
236 236
     // TODO - or just save nothing ?????
237 237
 //    throw new \Exception('EntityModel isNotEmpty, have dbId and not CHANGED! It can\'t be!');
238
-    throw new \Exception(__CLASS__ . '::unchanged() in ' . get_called_class() . 'is not yet implemented');
238
+    throw new \Exception(__CLASS__.'::unchanged() in '.get_called_class().'is not yet implemented');
239 239
   }
240 240
 
241 241
   protected function emptyAction(EntityContainer $cEntity) {
242 242
     // Just created container and doesn't use it
243 243
 //    throw new \Exception('EntityModel isEmpty but not loaded! It can\'t be!');
244
-    throw new \Exception(__CLASS__ . '::emptyAction() in ' . get_called_class() . 'is not yet implemented');
244
+    throw new \Exception(__CLASS__.'::emptyAction() in '.get_called_class().'is not yet implemented');
245 245
   }
246 246
 
247 247
   protected function save(EntityContainer $cEntity) {
Please login to merge, or discard this patch.
classes/Entity/EntityContainer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
     elseif ($value != $this->original[$name]) {
70 70
       $this->delta[$name] = $value;
71 71
       // New value not equal original value. We should update delta
72
-      if((is_int($value) || is_float($value))) {
72
+      if ((is_int($value) || is_float($value))) {
73 73
         $this->delta[$name] -= $this->original[$name];
74 74
       }
75 75
     }
Please login to merge, or discard this patch.
classes/Entity/KeyedModel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
     throw new \Exception('KeyedModel::update() is not yet implemented');
80 80
   }
81 81
 
82
-  protected function unchanged(KeyedContainer $cEntity){
82
+  protected function unchanged(KeyedContainer $cEntity) {
83 83
     // TODO - or just save nothing ?????
84 84
     // throw new \Exception('EntityModel isNotEmpty, have dbId and not CHANGED! It can\'t be!');
85 85
     // Do nothing
Please login to merge, or discard this patch.
classes/db_mysql_v5.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,19 +37,19 @@
 block discarded – undo
37 37
 
38 38
     $this->link = mysqli_connect($settings['server'], $settings['user'], $settings['pass'], $settings['name']);
39 39
     if (!is_object($this->link) || $this->link->connect_error) {
40
-      classSupernova::$debug->error_fatal('DB Error - cannot connect to server error #' . $this->link->connect_errno, $this->link->connect_error);
40
+      classSupernova::$debug->error_fatal('DB Error - cannot connect to server error #'.$this->link->connect_errno, $this->link->connect_error);
41 41
     }
42 42
 
43 43
 
44 44
     !$this->mysql_query("/*!40101 SET NAMES 'utf8' */")
45
-      ? classSupernova::$debug->error_fatal('DB error - cannot set names 1 error #' . $this->link->errno, $this->link->error)
45
+      ? classSupernova::$debug->error_fatal('DB error - cannot set names 1 error #'.$this->link->errno, $this->link->error)
46 46
       : false;
47 47
     !$this->mysql_query("SET NAMES 'utf8';")
48
-      ? classSupernova::$debug->error_fatal('DB error - cannot set names 2 error #' . $this->link->errno, $this->link->error)
48
+      ? classSupernova::$debug->error_fatal('DB error - cannot set names 2 error #'.$this->link->errno, $this->link->error)
49 49
       : false;
50 50
 
51
-    !$this->mysql_query('SET SESSION TRANSACTION ISOLATION LEVEL ' . self::DB_MYSQL_TRANSACTION_SERIALIZABLE . ';')
52
-      ? classSupernova::$debug->error_fatal('DB error - cannot set desired isolation level error #' . $this->link->errno, $this->link->error)
51
+    !$this->mysql_query('SET SESSION TRANSACTION ISOLATION LEVEL '.self::DB_MYSQL_TRANSACTION_SERIALIZABLE.';')
52
+      ? classSupernova::$debug->error_fatal('DB error - cannot set desired isolation level error #'.$this->link->errno, $this->link->error)
53 53
       : false;
54 54
 
55 55
     $this->connected = true;
Please login to merge, or discard this patch.