Completed
Push — work-fleets ( fc0000...961997 )
by SuperNova.WS
59:17
created
classes/Common/Invoker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
   }
16 16
 
17 17
   public static function build($callable) {
18
-    if(is_array($callable) && count($callable) == 2 && is_object($callable[0])) {
18
+    if (is_array($callable) && count($callable) == 2 && is_object($callable[0])) {
19 19
       return new static($callable);
20 20
     } else {
21 21
       return false;
Please login to merge, or discard this patch.
includes/includes/flt_mission_transport.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
   $source_planet = &$mission_data->src_planet;
19 19
   $destination_planet = &$mission_data->dst_planet;
20 20
 
21
-  if(empty($destination_planet['id_owner'])) {
21
+  if (empty($destination_planet['id_owner'])) {
22 22
     $objFleet->markReturnedAndSave();
23 23
 
24 24
     return $result;
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     $fleet_resources[RES_DEUTERIUM], classLocale::$lang['Deuterium']);
34 34
   DBStaticMessages::msg_send_simple_message($objFleet->target_owner_id, '', $objFleet->time_arrive_to_target, MSG_TYPE_TRANSPORT, classLocale::$lang['sys_mess_tower'], classLocale::$lang['sys_mess_transport'], $Message);
35 35
 
36
-  if($objFleet->target_owner_id <> $objFleet->playerOwnerId) {
36
+  if ($objFleet->target_owner_id <> $objFleet->playerOwnerId) {
37 37
     DBStaticMessages::msg_send_simple_message($objFleet->playerOwnerId, '', $objFleet->time_arrive_to_target, MSG_TYPE_TRANSPORT, classLocale::$lang['sys_mess_tower'], classLocale::$lang['sys_mess_transport'], $Message);
38 38
   }
39 39
 
Please login to merge, or discard this patch.
includes/includes/flt_flying_fleet_handler2.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,6 @@
 block discarded – undo
14 14
  *
15 15
  * @param Fleet $objFleet
16 16
  * @param bool  $start
17
- * @param null  $result
18 17
  *
19 18
  * @return mixed
20 19
  */
Please login to merge, or discard this patch.
Spacing   +9 added lines, -13 removed lines patch added patch discarded remove patch
@@ -23,15 +23,11 @@  discard block
 block discarded – undo
23 23
 // ------------------------------------------------------------------
24 24
 function flt_flyingFleetsSort($a, $b) {
25 25
   // Сравниваем время флотов - кто раньше, тот и первый обрабатывается
26
-  return $a['fleet_time'] > $b['fleet_time'] ? 1 : ($a['fleet_time'] < $b['fleet_time'] ? -1 :
27
-    // Если время - одинаковое, сравниваем события флотов
26
+  return $a['fleet_time'] > $b['fleet_time'] ? 1 : ($a['fleet_time'] < $b['fleet_time'] ? -1 : // Если время - одинаковое, сравниваем события флотов
28 27
     // Если события - одинаковые, то флоты равны
29
-    ($a['fleet_event'] == $b['fleet_event'] ? 0 :
30
-      // Если события разные - первыми считаем прибывающие флоты
31
-      ($a['fleet_event'] == EVENT_FLT_ARRIVE ? 1 : ($b['fleet_event'] == EVENT_FLT_ARRIVE ? -1 :
32
-        // Если нет прибывающих флотов - дальше считаем флоты, которые закончили миссию
33
-        ($a['fleet_event'] == EVENT_FLT_ACOMPLISH ? 1 : ($b['fleet_event'] == EVENT_FLT_ACOMPLISH ? -1 :
34
-          // Если нет флотов, закончивших задание - остались возвращающиеся флоты, которые равны между собой
28
+    ($a['fleet_event'] == $b['fleet_event'] ? 0 : // Если события разные - первыми считаем прибывающие флоты
29
+      ($a['fleet_event'] == EVENT_FLT_ARRIVE ? 1 : ($b['fleet_event'] == EVENT_FLT_ARRIVE ? -1 : // Если нет прибывающих флотов - дальше считаем флоты, которые закончили миссию
30
+        ($a['fleet_event'] == EVENT_FLT_ACOMPLISH ? 1 : ($b['fleet_event'] == EVENT_FLT_ACOMPLISH ? -1 : // Если нет флотов, закончивших задание - остались возвращающиеся флоты, которые равны между собой
35 31
           // TODO: Добавить еще проверку по ID флота и/или времени запуска - что бы обсчитывать их в порядке запуска
36 32
           (
37 33
           0 // Вообще сюда доходить не должно - будет отсекаться на равенстве событий
@@ -49,13 +45,13 @@  discard block
 block discarded – undo
49 45
     $handler = fopen('event.log', 'a+');
50 46
   }
51 47
 
52
-  fwrite($handler, date(FMT_DATE_TIME_SQL, time()) . ' ' . $msg . "\r\n");
48
+  fwrite($handler, date(FMT_DATE_TIME_SQL, time()).' '.$msg."\r\n");
53 49
 }
54 50
 
55 51
 // ------------------------------------------------------------------
56 52
 function flt_flying_fleet_handler($skip_fleet_update = false) {
57 53
   if (true) {
58
-    if(!defined('IN_AJAX')) {
54
+    if (!defined('IN_AJAX')) {
59 55
       print('<div style="color: red; font-size: 300%">Fleet handler is disabled</div>');
60 56
       pdump('Fleet handler is disabled');
61 57
     }
@@ -181,7 +177,7 @@  discard block
 block discarded – undo
181 177
     MT_EXPLORE   => 'flt_mission_explore',
182 178
   );
183 179
   foreach ($missions_used as $mission_id => $cork) {
184
-    require_once(SN_ROOT_PHYSICAL . "includes/includes/{$mission_files[$mission_id]}" . DOT_PHP_EX);
180
+    require_once(SN_ROOT_PHYSICAL."includes/includes/{$mission_files[$mission_id]}".DOT_PHP_EX);
185 181
   }
186 182
 
187 183
 //log_file('Обработка миссий');
@@ -190,7 +186,7 @@  discard block
 block discarded – undo
190 186
     // Watchdog timer
191 187
     // If flying fleet handler works more then 10 seconds - stopping it
192 188
     // Let next run handle rest of fleets
193
-    if(time() - SN_TIME_NOW > 10) {
189
+    if (time() - SN_TIME_NOW > 10) {
194 190
       $debug->warning('Flying fleet handler standard routine works more then 10 seconds - watchdog unlocked', 'FFH Warning', 504);
195 191
       break;
196 192
     }
@@ -256,7 +252,7 @@  discard block
 block discarded – undo
256 252
     $objMission->fleet_event = $fleet_event['fleet_event'];
257 253
 
258 254
     // Fleet that have planet destination is returned
259
-    if($mission_data['dst_planet'] && empty($objMission->dst_planet['id_owner'])) {
255
+    if ($mission_data['dst_planet'] && empty($objMission->dst_planet['id_owner'])) {
260 256
       $objFleet->markReturnedAndSave();
261 257
       sn_db_transaction_commit();
262 258
       continue;
Please login to merge, or discard this patch.
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/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/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/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.