Test Failed
Push — trunk ( e02d87...314b8c )
by SuperNova.WS
07:20
created
classes/DBAL/DbIndexField.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     $this->Collation    = isset($indexField['Collation']) ? $indexField['Collation'] : null;
28 28
     $this->Cardinality  = isset($indexField['Cardinality']) ? $indexField['Cardinality'] : null;
29 29
     $this->Sub_part     = isset($indexField['Sub_part']) ? $indexField['Sub_part'] : null;
30
-    $this->Null         = isset($indexField['Null']) ? $indexField['Null'] : null;
30
+    $this->null         = isset($indexField['Null']) ? $indexField['Null'] : null;
31 31
     $this->Expression   = isset($indexField['Expression']) ? $indexField['Expression'] : null;
32 32
 
33 33
     return $this;
Please login to merge, or discard this patch.
classes/DBAL/PropertyDescription.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@
 block discarded – undo
153 153
 
154 154
 
155 155
     // If this field is not null and default value is not set - then this field is mandatory
156
-    if ($fieldDescription->Null === 'NO' && $fieldDescription->Default === null && !$nonMandatory) {
156
+    if ($fieldDescription->null === 'NO' && $fieldDescription->Default === null && !$nonMandatory) {
157 157
       $this->mandatory = true;
158 158
     }
159 159
 
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,14 +6,14 @@
 block discarded – undo
6 6
 
7 7
 global $sn_page_name, $sn_mvc, $template, $template_result;
8 8
 
9
-if(isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) {
9
+if (isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) {
10 10
   require_once('common.' . substr(strrchr(__FILE__, '.'), 1));
11
-  if($sn_page_name) {
11
+  if ($sn_page_name) {
12 12
     // Loading page-specific language files
13 13
 
14 14
     !empty($sn_mvc['model'][$sn_page_name]) and execute_hooks($sn_mvc['model'][$sn_page_name], $template, 'model', $sn_page_name);
15 15
     !empty($sn_mvc['view'][$sn_page_name]) and execute_hooks($sn_mvc['view'][$sn_page_name], $template, 'view', $sn_page_name);
16
-    if(!empty($template_result) && is_object($template)) {
16
+    if (!empty($template_result) && is_object($template)) {
17 17
       $template->assign_recursive($template_result);
18 18
     }
19 19
 
Please login to merge, or discard this patch.
includes/db.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
  * @copyright 2008-2015 Gorlum for Project "SuperNova.WS"
6 6
  */
7 7
 
8
-if(!defined('INSIDE')) {
8
+if (!defined('INSIDE')) {
9 9
   die();
10 10
 }
11 11
 
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 function db_change_units_perform($query, $tablename, $object_id) {
15 15
   $query = implode(',', $query);
16
-  if($query && $object_id) {
16
+  if ($query && $object_id) {
17 17
     return SN::db_upd_record_by_id($tablename == 'users' ? LOC_USER : LOC_PLANET, $object_id, $query);
18 18
   }
19 19
 }
@@ -29,15 +29,15 @@  discard block
 block discarded – undo
29 29
 
30 30
   $group = sn_get_groups('resources_loot');
31 31
 
32
-  foreach($unit_list as $unit_id => $unit_amount) {
33
-    if(!in_array($unit_id, $group)) {
32
+  foreach ($unit_list as $unit_id => $unit_amount) {
33
+    if (!in_array($unit_id, $group)) {
34 34
       // TODO - remove later
35 35
       print('<h1>СООБЩИТЕ ЭТО АДМИНУ: db_change_units() вызван для не-ресурсов!</h1>');
36 36
       pdump(debug_backtrace());
37 37
       die('db_change_units() вызван для не-ресурсов!');
38 38
     }
39 39
 
40
-    if(!$unit_amount) {
40
+    if (!$unit_amount) {
41 41
       continue;
42 42
     }
43 43
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     $unit_location = sys_get_unit_location($user, $planet, $unit_id);
47 47
 
48 48
     // Changing value in object
49
-    switch($unit_location) {
49
+    switch ($unit_location) {
50 50
       case LOC_USER:
51 51
         $user[$unit_db_name] += $unit_amount;
52 52
         break;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
  * @deprecated
110 110
  */
111 111
 function doquery($query, $table = '', $fetch = false, $skip_query_check = false) {
112
-  if(is_bool($table) || !is_string($table)) {
112
+  if (is_bool($table) || !is_string($table)) {
113 113
     $fetch = $table;
114 114
   }
115 115
   return SN::$db->doquery($query, $fetch, $skip_query_check);
Please login to merge, or discard this patch.
includes/vars.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1190,12 +1190,12 @@
 block discarded – undo
1190 1190
     ],
1191 1191
     // Defensive building list
1192 1192
     UNIT_DEFENCE_STR => [UNIT_DEF_TURRET_MISSILE   => UNIT_DEF_TURRET_MISSILE, UNIT_DEF_TURRET_LASER_SMALL => UNIT_DEF_TURRET_LASER_SMALL,
1193
-                         UNIT_DEF_TURRET_LASER_BIG => UNIT_DEF_TURRET_LASER_BIG, UNIT_DEF_TURRET_GAUSS => UNIT_DEF_TURRET_GAUSS,
1194
-                         UNIT_DEF_TURRET_ION       => UNIT_DEF_TURRET_ION, UNIT_DEF_TURRET_PLASMA => UNIT_DEF_TURRET_PLASMA,
1193
+                          UNIT_DEF_TURRET_LASER_BIG => UNIT_DEF_TURRET_LASER_BIG, UNIT_DEF_TURRET_GAUSS => UNIT_DEF_TURRET_GAUSS,
1194
+                          UNIT_DEF_TURRET_ION       => UNIT_DEF_TURRET_ION, UNIT_DEF_TURRET_PLASMA => UNIT_DEF_TURRET_PLASMA,
1195 1195
 
1196
-                         UNIT_DEF_SHIELD_SMALL => UNIT_DEF_SHIELD_SMALL, UNIT_DEF_SHIELD_BIG => UNIT_DEF_SHIELD_BIG, UNIT_DEF_SHIELD_PLANET => UNIT_DEF_SHIELD_PLANET,
1196
+                          UNIT_DEF_SHIELD_SMALL => UNIT_DEF_SHIELD_SMALL, UNIT_DEF_SHIELD_BIG => UNIT_DEF_SHIELD_BIG, UNIT_DEF_SHIELD_PLANET => UNIT_DEF_SHIELD_PLANET,
1197 1197
 
1198
-                         UNIT_DEF_MISSILE_INTERCEPTOR => UNIT_DEF_MISSILE_INTERCEPTOR, UNIT_DEF_MISSILE_INTERPLANET => UNIT_DEF_MISSILE_INTERPLANET,
1198
+                          UNIT_DEF_MISSILE_INTERCEPTOR => UNIT_DEF_MISSILE_INTERCEPTOR, UNIT_DEF_MISSILE_INTERPLANET => UNIT_DEF_MISSILE_INTERPLANET,
1199 1199
     ],
1200 1200
 
1201 1201
     // Missiles list
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -601,29 +601,29 @@  discard block
 block discarded – undo
601 601
         P_MISSION_EXPEDITION_OUTCOME           => FLT_EXPEDITION_OUTCOME_FOUND_FLEET,
602 602
         P_MISSION_EXPEDITION_OUTCOME_TYPE      => FLT_EXPEDITION_OUTCOME_TYPE_GOOD,
603 603
         P_CHANCE                               => 200,
604
-        'percent'                              => [0 => 0.1, 1 => 0.02, 2 => 0.01,],
604
+        'percent'                              => [0 => 0.1, 1 => 0.02, 2 => 0.01, ],
605 605
         P_MISSION_EXPEDITION_OUTCOME_SECONDARY => [
606
-          [P_CHANCE => 90, P_MULTIPLIER => 0.01, P_MESSAGE_ID => 2,],
607
-          [P_CHANCE => 9, P_MULTIPLIER => 0.02, P_MESSAGE_ID => 1,],
608
-          [P_CHANCE => 1, P_MULTIPLIER => 0.10, P_MESSAGE_ID => 0,],
606
+          [P_CHANCE => 90, P_MULTIPLIER => 0.01, P_MESSAGE_ID => 2, ],
607
+          [P_CHANCE => 9, P_MULTIPLIER => 0.02, P_MESSAGE_ID => 1, ],
608
+          [P_CHANCE => 1, P_MULTIPLIER => 0.10, P_MESSAGE_ID => 0, ],
609 609
         ],
610 610
       ],
611 611
       FLT_EXPEDITION_OUTCOME_FOUND_RESOURCES => [
612 612
         P_MISSION_EXPEDITION_OUTCOME           => FLT_EXPEDITION_OUTCOME_FOUND_RESOURCES,
613 613
         P_MISSION_EXPEDITION_OUTCOME_TYPE      => FLT_EXPEDITION_OUTCOME_TYPE_GOOD,
614 614
         P_CHANCE                               => 300,
615
-        'percent'                              => [0 => 0.1, 1 => 0.050, 2 => 0.025,],
615
+        'percent'                              => [0 => 0.1, 1 => 0.050, 2 => 0.025, ],
616 616
         P_MISSION_EXPEDITION_OUTCOME_SECONDARY => [
617
-          [P_CHANCE => 90, P_MULTIPLIER => 0.025, P_MESSAGE_ID => 2,],
618
-          [P_CHANCE => 9, P_MULTIPLIER => 0.050, P_MESSAGE_ID => 1,],
619
-          [P_CHANCE => 1, P_MULTIPLIER => 0.100, P_MESSAGE_ID => 0,],
617
+          [P_CHANCE => 90, P_MULTIPLIER => 0.025, P_MESSAGE_ID => 2, ],
618
+          [P_CHANCE => 9, P_MULTIPLIER => 0.050, P_MESSAGE_ID => 1, ],
619
+          [P_CHANCE => 1, P_MULTIPLIER => 0.100, P_MESSAGE_ID => 0, ],
620 620
         ],
621 621
       ],
622 622
       FLT_EXPEDITION_OUTCOME_FOUND_DM        => [
623 623
         P_MISSION_EXPEDITION_OUTCOME           => FLT_EXPEDITION_OUTCOME_FOUND_DM,
624 624
         P_MISSION_EXPEDITION_OUTCOME_TYPE      => FLT_EXPEDITION_OUTCOME_TYPE_GOOD,
625 625
         P_CHANCE                               => 100,
626
-        'percent'                              => [0 => 0.0100, 1 => 0.0040, 2 => 0.0010,],
626
+        'percent'                              => [0 => 0.0100, 1 => 0.0040, 2 => 0.0010, ],
627 627
         P_MISSION_EXPEDITION_OUTCOME_SECONDARY => [
628 628
           [P_CHANCE => 90, P_MULTIPLIER => 0.0010, /*P_MESSAGE_ID => 2,*/],
629 629
           [P_CHANCE => 9, P_MULTIPLIER => 0.0040, /*P_MESSAGE_ID => 1,*/],
@@ -658,14 +658,14 @@  discard block
 block discarded – undo
658 658
     ],
659 659
 
660 660
     'planet_generator' => [
661
-      0  => [ // HomeWorld
661
+      0  => [// HomeWorld
662 662
         't_max_min'     => 40, // Tmax 40
663 663
         't_max_max'     => 40,
664 664
         't_delta_min'   => 40, // Tmin 0
665 665
         't_delta_max'   => 40,
666 666
         'size_min'      => $config->initial_fields,
667 667
         'size_max'      => $config->initial_fields,
668
-        'core_types'    => [PLANET_DENSITY_STANDARD,],
668
+        'core_types'    => [PLANET_DENSITY_STANDARD, ],
669 669
         'planet_images' => ['normaltemp'],
670 670
       ],
671 671
       1  => [
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
         ],
896 896
         'planet_images' => ['eis'],
897 897
       ],
898
-      16 => [ // Random planet - stranger; -35 avg
898
+      16 => [// Random planet - stranger; -35 avg
899 899
         't_max_min'     => -90,
900 900
         't_max_max'     => +40,
901 901
         't_delta_min'   => 2,
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
           PLANET_DENSITY_METAL_PERIDOT,
916 916
           PLANET_DENSITY_METAL_RAW,
917 917
         ],
918
-        'planet_images' => ['trocken', 'dschjungel', 'normaltemp', 'wasser', 'eis',],
918
+        'planet_images' => ['trocken', 'dschjungel', 'normaltemp', 'wasser', 'eis', ],
919 919
       ],
920 920
     ],
921 921
 
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
         UNIT_PLANET_DENSITY_INDEX         => PLANET_DENSITY_ICE_HYDROGEN,
939 939
         UNIT_PLANET_DENSITY_RARITY        => 30, // 1, // 40.00, // * 1/121 0,82645
940 940
         UNIT_PLANET_DENSITY_RICHNESS      => PLANET_DENSITY_RICHNESS_PERFECT,
941
-        UNIT_RESOURCES                    => [RES_METAL => 0.20, RES_CRYSTAL => 0.60, RES_DEUTERIUM => 7.10,],
941
+        UNIT_RESOURCES                    => [RES_METAL => 0.20, RES_CRYSTAL => 0.60, RES_DEUTERIUM => 7.10, ],
942 942
         UNIT_PLANET_DENSITY_MAX_SECTORS   => 150,
943 943
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 11,
944 944
       ],
@@ -947,7 +947,7 @@  discard block
 block discarded – undo
947 947
         UNIT_PLANET_DENSITY_INDEX         => PLANET_DENSITY_ICE_METHANE,
948 948
         UNIT_PLANET_DENSITY_RARITY        => 130, // 6, // 6.67, // * 6,0	4,95868
949 949
         UNIT_PLANET_DENSITY_RICHNESS      => PLANET_DENSITY_RICHNESS_GOOD,
950
-        UNIT_RESOURCES                    => [RES_METAL => 0.55, RES_CRYSTAL => 0.85, RES_DEUTERIUM => 4.60,],
950
+        UNIT_RESOURCES                    => [RES_METAL => 0.55, RES_CRYSTAL => 0.85, RES_DEUTERIUM => 4.60, ],
951 951
         UNIT_PLANET_DENSITY_MAX_SECTORS   => 200,
952 952
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 6,
953 953
       ],
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
         UNIT_PLANET_DENSITY_INDEX         => PLANET_DENSITY_ICE_WATER,
957 957
         UNIT_PLANET_DENSITY_RARITY        => 450, //20, // 2.00, // * 20,0	16,52893
958 958
         UNIT_PLANET_DENSITY_RICHNESS      => PLANET_DENSITY_RICHNESS_AVERAGE,
959
-        UNIT_RESOURCES                    => [RES_METAL => 0.86, RES_CRYSTAL => 0.95, RES_DEUTERIUM => 2.20,],
959
+        UNIT_RESOURCES                    => [RES_METAL => 0.86, RES_CRYSTAL => 0.95, RES_DEUTERIUM => 2.20, ],
960 960
         UNIT_PLANET_DENSITY_MAX_SECTORS   => 999,
961 961
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0,
962 962
       ],
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
         UNIT_PLANET_DENSITY_INDEX         => PLANET_DENSITY_CRYSTAL_RAW,
967 967
         UNIT_PLANET_DENSITY_RARITY        => 20, // 1, // 40.00, // *1,0	0,82645
968 968
         UNIT_PLANET_DENSITY_RICHNESS      => PLANET_DENSITY_RICHNESS_PERFECT,
969
-        UNIT_RESOURCES                    => [RES_METAL => 0.40, RES_CRYSTAL => 12.37, RES_DEUTERIUM => 0.50,],
969
+        UNIT_RESOURCES                    => [RES_METAL => 0.40, RES_CRYSTAL => 12.37, RES_DEUTERIUM => 0.50, ],
970 970
         UNIT_PLANET_DENSITY_MAX_SECTORS   => 150,
971 971
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 11,
972 972
       ],
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
         UNIT_PLANET_DENSITY_INDEX         => PLANET_DENSITY_CRYSTAL_SILICATE,
976 976
         UNIT_PLANET_DENSITY_RARITY        => 140, // 5.71, // * 7,0	5,78512
977 977
         UNIT_PLANET_DENSITY_RICHNESS      => PLANET_DENSITY_RICHNESS_GOOD,
978
-        UNIT_RESOURCES                    => [RES_METAL => 0.67, RES_CRYSTAL => 4.50, RES_DEUTERIUM => 0.85,],
978
+        UNIT_RESOURCES                    => [RES_METAL => 0.67, RES_CRYSTAL => 4.50, RES_DEUTERIUM => 0.85, ],
979 979
         UNIT_PLANET_DENSITY_MAX_SECTORS   => 200,
980 980
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 6,
981 981
       ],
@@ -984,7 +984,7 @@  discard block
 block discarded – undo
984 984
         UNIT_PLANET_DENSITY_INDEX         => PLANET_DENSITY_CRYSTAL_STONE,
985 985
         UNIT_PLANET_DENSITY_RARITY        => 500, // 1.90, // * 21,0	17,35537
986 986
         UNIT_PLANET_DENSITY_RICHNESS      => PLANET_DENSITY_RICHNESS_AVERAGE,
987
-        UNIT_RESOURCES                    => [RES_METAL => 0.80, RES_CRYSTAL => 2.00, RES_DEUTERIUM => 0.95,],
987
+        UNIT_RESOURCES                    => [RES_METAL => 0.80, RES_CRYSTAL => 2.00, RES_DEUTERIUM => 0.95, ],
988 988
         UNIT_PLANET_DENSITY_MAX_SECTORS   => 999,
989 989
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0,
990 990
       ],
@@ -994,7 +994,7 @@  discard block
 block discarded – undo
994 994
         UNIT_PLANET_DENSITY_INDEX         => PLANET_DENSITY_STANDARD,
995 995
         UNIT_PLANET_DENSITY_RARITY        => 1000, // 1.0, // * 40,0	33,05785
996 996
         UNIT_PLANET_DENSITY_RICHNESS      => PLANET_DENSITY_RICHNESS_NORMAL,
997
-        UNIT_RESOURCES                    => [RES_METAL => 1.00, RES_CRYSTAL => 1.00, RES_DEUTERIUM => 1.00,],
997
+        UNIT_RESOURCES                    => [RES_METAL => 1.00, RES_CRYSTAL => 1.00, RES_DEUTERIUM => 1.00, ],
998 998
         UNIT_PLANET_DENSITY_MAX_SECTORS   => 999,
999 999
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0,
1000 1000
       ],
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
         UNIT_PLANET_DENSITY_INDEX         => PLANET_DENSITY_METAL_ORE,
1005 1005
         UNIT_PLANET_DENSITY_RARITY        => 550, // 2.11, // * 19,0	15,70248
1006 1006
         UNIT_PLANET_DENSITY_RICHNESS      => PLANET_DENSITY_RICHNESS_AVERAGE,
1007
-        UNIT_RESOURCES                    => [RES_METAL => 1.60, RES_CRYSTAL => 0.90, RES_DEUTERIUM => 0.80,],
1007
+        UNIT_RESOURCES                    => [RES_METAL => 1.60, RES_CRYSTAL => 0.90, RES_DEUTERIUM => 0.80, ],
1008 1008
         UNIT_PLANET_DENSITY_MAX_SECTORS   => 999,
1009 1009
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 0,
1010 1010
       ],
@@ -1013,7 +1013,7 @@  discard block
 block discarded – undo
1013 1013
         UNIT_PLANET_DENSITY_INDEX         => PLANET_DENSITY_METAL_PERIDOT,
1014 1014
         UNIT_PLANET_DENSITY_RARITY        => 120, // 8.00, // * 5,0	4,13223
1015 1015
         UNIT_PLANET_DENSITY_RICHNESS      => PLANET_DENSITY_RICHNESS_GOOD,
1016
-        UNIT_RESOURCES                    => [RES_METAL => 4.71, RES_CRYSTAL => 0.80, RES_DEUTERIUM => 0.55,],
1016
+        UNIT_RESOURCES                    => [RES_METAL => 4.71, RES_CRYSTAL => 0.80, RES_DEUTERIUM => 0.55, ],
1017 1017
         UNIT_PLANET_DENSITY_MAX_SECTORS   => 200,
1018 1018
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 6,
1019 1019
       ],
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
         UNIT_PLANET_DENSITY_INDEX         => PLANET_DENSITY_METAL_RAW,
1023 1023
         UNIT_PLANET_DENSITY_RARITY        => 25, // 40.00, // * 1,0	0,82645
1024 1024
         UNIT_PLANET_DENSITY_RICHNESS      => PLANET_DENSITY_RICHNESS_PERFECT,
1025
-        UNIT_RESOURCES                    => [RES_METAL => 8.00, RES_CRYSTAL => 0.40, RES_DEUTERIUM => 0.25,],
1025
+        UNIT_RESOURCES                    => [RES_METAL => 8.00, RES_CRYSTAL => 0.40, RES_DEUTERIUM => 0.25, ],
1026 1026
         UNIT_PLANET_DENSITY_MAX_SECTORS   => 150,
1027 1027
         UNIT_PLANET_DENSITY_MIN_ASTROTECH => 11,
1028 1028
       ],
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
     ],
1200 1200
 
1201 1201
     // Missiles list
1202
-    UNIT_DEF_MISSILES_STR => [UNIT_DEF_MISSILE_INTERCEPTOR => UNIT_DEF_MISSILE_INTERCEPTOR, UNIT_DEF_MISSILE_INTERPLANET => UNIT_DEF_MISSILE_INTERPLANET,],
1202
+    UNIT_DEF_MISSILES_STR => [UNIT_DEF_MISSILE_INTERCEPTOR => UNIT_DEF_MISSILE_INTERCEPTOR, UNIT_DEF_MISSILE_INTERPLANET => UNIT_DEF_MISSILE_INTERPLANET, ],
1203 1203
 
1204 1204
     // Combat units list
1205 1205
     'combat'             => [
@@ -1248,7 +1248,7 @@  discard block
 block discarded – undo
1248 1248
     // Resource list
1249 1249
     UNIT_RESOURCES_STR      => [0 => 'metal', 1 => 'crystal', 2 => 'deuterium', 3 => 'dark_matter'],
1250 1250
     // Resources all
1251
-    'resources_all'         => [RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_ENERGY => RES_ENERGY, RES_DARK_MATTER => RES_DARK_MATTER, RES_METAMATTER => RES_METAMATTER,],
1251
+    'resources_all'         => [RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_ENERGY => RES_ENERGY, RES_DARK_MATTER => RES_DARK_MATTER, RES_METAMATTER => RES_METAMATTER, ],
1252 1252
     // Resources can be produced on planet
1253 1253
     'resources_planet'      => [RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_ENERGY => RES_ENERGY],
1254 1254
     // Resources can be looted from planet
@@ -1267,13 +1267,13 @@  discard block
 block discarded – undo
1267 1267
     ],
1268 1268
 
1269 1269
     // Resources that can be tradeable in market trader AND be a quest_rewards
1270
-    'quest_rewards'      => [RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_DARK_MATTER => RES_DARK_MATTER,],
1270
+    'quest_rewards'      => [RES_METAL => RES_METAL, RES_CRYSTAL => RES_CRYSTAL, RES_DEUTERIUM => RES_DEUTERIUM, RES_DARK_MATTER => RES_DARK_MATTER, ],
1271 1271
 
1272 1272
 //      // Ques list
1273 1273
 //      'ques' => array(QUE_STRUCTURES, QUE_HANGAR, QUE_RESEARCH),
1274 1274
 
1275
-    'STAT_COMMON' => [STAT_TOTAL => STAT_TOTAL, STAT_FLEET => STAT_FLEET, STAT_TECH => STAT_TECH, STAT_BUILDING => STAT_BUILDING, STAT_DEFENSE => STAT_DEFENSE, STAT_RESOURCE => STAT_RESOURCE,],
1276
-    'STAT_PLAYER' => [STAT_RAID_TOTAL => STAT_RAID_TOTAL, STAT_RAID_WON => STAT_RAID_WON, STAT_RAID_LOST => STAT_RAID_LOST, STAT_LVL_BUILDING => STAT_LVL_BUILDING, STAT_LVL_TECH => STAT_LVL_TECH, STAT_LVL_RAID => STAT_LVL_RAID,],
1275
+    'STAT_COMMON' => [STAT_TOTAL => STAT_TOTAL, STAT_FLEET => STAT_FLEET, STAT_TECH => STAT_TECH, STAT_BUILDING => STAT_BUILDING, STAT_DEFENSE => STAT_DEFENSE, STAT_RESOURCE => STAT_RESOURCE, ],
1276
+    'STAT_PLAYER' => [STAT_RAID_TOTAL => STAT_RAID_TOTAL, STAT_RAID_WON => STAT_RAID_WON, STAT_RAID_LOST => STAT_RAID_LOST, STAT_LVL_BUILDING => STAT_LVL_BUILDING, STAT_LVL_TECH => STAT_LVL_TECH, STAT_LVL_RAID => STAT_LVL_RAID, ],
1277 1277
 
1278 1278
     GROUP_GROUP_ID_TO_NAMES => [
1279 1279
       UNIT_STRUCTURES   => 'structures',
@@ -1287,7 +1287,7 @@  discard block
 block discarded – undo
1287 1287
       UNIT_PLANS        => 'plans',
1288 1288
     ],
1289 1289
 
1290
-    GROUP_CAPITAL_BUILDING_BONUS_GROUPS => ['structures', 'defense', 'fleet',],
1290
+    GROUP_CAPITAL_BUILDING_BONUS_GROUPS => ['structures', 'defense', 'fleet', ],
1291 1291
 
1292 1292
     GROUP_UNIT_COMBAT_SORT_ORDER => [
1293 1293
       SHIP_SPY,
Please login to merge, or discard this patch.
includes/general/general.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     }
122 122
   }
123 123
 
124
-  if($prepend) {
124
+  if ($prepend) {
125 125
     array_unshift($functions[$function_name], $function_data);
126 126
   } else {
127 127
     $functions[$function_name][] = $function_data;
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
     $time_left = min(floor($time_left / PERIOD_DAY), $term_original);
333 333
     $cost_left = $term_original > 0 ? ceil($time_left / $term_original * $original_cost) : 0;
334 334
 
335
-    array_walk_recursive($result, function (&$value) use ($cost_left) {
335
+    array_walk_recursive($result, function(&$value) use ($cost_left) {
336 336
       $value -= $cost_left;
337 337
     });
338 338
   }
Please login to merge, or discard this patch.
includes/general/general_urlAndHttp.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
   );
87 87
 
88 88
   // Quick hack to support IPv6 at least on local host
89
-  if($ip['ip'] == '::1') {
89
+  if ($ip['ip'] == '::1') {
90 90
     $ip['ip'] = '127.0.0.1';
91 91
   }
92 92
 
Please login to merge, or discard this patch.
includes/includes/flt_page3.inc 2 patches
Braces   +41 added lines, -30 removed lines patch added patch discarded remove patch
@@ -23,18 +23,24 @@  discard block
 block discarded – undo
23 23
 
24 24
   // Test de coherance de la destination (voir si elle se trouve dans les limites de l'univers connu
25 25
   $errorlist = '';
26
-  if (!$galaxy || $galaxy > $config->game_maxGalaxy || $galaxy < 1)
27
-    $errorlist .= $lang['fl_limit_galaxy'];
28
-  if (!$system || $system > $config->game_maxSystem || $system < 1)
29
-    $errorlist .= $lang['fl_limit_system'];
30
-  if (!$planet || $planet < 1 || ($planet > $config->game_maxPlanet && $target_mission != MT_EXPLORE ))
31
-    $errorlist .= $lang['fl_limit_planet'];
32
-  if ($planetrow['galaxy'] == $galaxy && $planetrow['system'] == $system && $planetrow['planet'] == $planet && $planetrow['planet_type'] == $planet_type)
33
-    $errorlist .= $lang['fl_ownpl_err'];
34
-  if (!$planet_type)
35
-    $errorlist .= $lang['fl_no_planettype'];
36
-  if ($planet_type != PT_PLANET && $planet_type != PT_DEBRIS && $planet_type != PT_MOON)
37
-    $errorlist .= $lang['fl_fleet_err_pl'];
26
+  if (!$galaxy || $galaxy > $config->game_maxGalaxy || $galaxy < 1) {
27
+      $errorlist .= $lang['fl_limit_galaxy'];
28
+  }
29
+  if (!$system || $system > $config->game_maxSystem || $system < 1) {
30
+      $errorlist .= $lang['fl_limit_system'];
31
+  }
32
+  if (!$planet || $planet < 1 || ($planet > $config->game_maxPlanet && $target_mission != MT_EXPLORE )) {
33
+      $errorlist .= $lang['fl_limit_planet'];
34
+  }
35
+  if ($planetrow['galaxy'] == $galaxy && $planetrow['system'] == $system && $planetrow['planet'] == $planet && $planetrow['planet_type'] == $planet_type) {
36
+      $errorlist .= $lang['fl_ownpl_err'];
37
+  }
38
+  if (!$planet_type) {
39
+      $errorlist .= $lang['fl_no_planettype'];
40
+  }
41
+  if ($planet_type != PT_PLANET && $planet_type != PT_DEBRIS && $planet_type != PT_MOON) {
42
+      $errorlist .= $lang['fl_fleet_err_pl'];
43
+  }
38 44
   if (empty($missiontype[$target_mission])) {
39 45
     $errorlist .= $lang['fl_bad_mission'];
40 46
   }
@@ -61,29 +67,35 @@  discard block
 block discarded – undo
61 67
     }
62 68
   } else {
63 69
     if ($TargetPlanet['id_owner']){
64
-      if ($target_mission == MT_COLONIZE)
65
-        $errorlist .= $lang['fl_colonized'];
70
+      if ($target_mission == MT_COLONIZE) {
71
+              $errorlist .= $lang['fl_colonized'];
72
+      }
66 73
 
67 74
       if ($TargetPlanet['id_owner'] == $planetrow['id_owner']){
68
-        if ($target_mission == MT_ATTACK)
69
-          $errorlist .= $lang['fl_no_self_attack'];
70
-
71
-        if ($target_mission == MT_SPY)
72
-          $errorlist .= $lang['fl_no_self_spy'];
73
-      }else{
74
-        if ($target_mission == MT_RELOCATE)
75
-          $errorlist .= $lang['fl_only_stay_at_home'];
75
+        if ($target_mission == MT_ATTACK) {
76
+                  $errorlist .= $lang['fl_no_self_attack'];
77
+        }
78
+
79
+        if ($target_mission == MT_SPY) {
80
+                  $errorlist .= $lang['fl_no_self_spy'];
81
+        }
82
+      } else{
83
+        if ($target_mission == MT_RELOCATE) {
84
+                  $errorlist .= $lang['fl_only_stay_at_home'];
85
+        }
76 86
       }
77
-    }else{
87
+    } else{
78 88
       if ($target_mission < MT_COLONIZE){
79 89
         $errorlist .= $lang['fl_unknow_target'];
80
-      }else{
81
-        if ($target_mission == MT_DESTROY)
82
-          $errorlist .= $lang['fl_nomoon'];
90
+      } else{
91
+        if ($target_mission == MT_DESTROY) {
92
+                  $errorlist .= $lang['fl_nomoon'];
93
+        }
83 94
 
84 95
         if ($target_mission == MT_RECYCLE){
85
-          if($TargetPlanet['debris_metal'] + $TargetPlanet['debris_crystal'] == 0)
86
-            $errorlist .= $lang['fl_nodebris'];
96
+          if($TargetPlanet['debris_metal'] + $TargetPlanet['debris_crystal'] == 0) {
97
+                      $errorlist .= $lang['fl_nodebris'];
98
+          }
87 99
         }
88 100
       }
89 101
     }
@@ -131,8 +143,7 @@  discard block
 block discarded – undo
131 143
       $aks = DbFleetStatic::dbAcsGetById($fleet_group);
132 144
       if (!$aks) {
133 145
         $fleet_group = 0;
134
-      }
135
-      else
146
+      } else
136 147
       {
137 148
         $galaxy = $aks['galaxy'];
138 149
         $system = $aks['system'];
Please login to merge, or discard this patch.
Spacing   +34 added lines, -35 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 use Planet\DBStaticPlanet;
9 9
 use Unit\DBStaticUnit;
10 10
 
11
-if(SN_IN_FLEET !== true) {
11
+if (SN_IN_FLEET !== true) {
12 12
   $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403);
13 13
 }
14 14
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     $errorlist .= $lang['fl_limit_galaxy'];
28 28
   if (!$system || $system > $config->game_maxSystem || $system < 1)
29 29
     $errorlist .= $lang['fl_limit_system'];
30
-  if (!$planet || $planet < 1 || ($planet > $config->game_maxPlanet && $target_mission != MT_EXPLORE ))
30
+  if (!$planet || $planet < 1 || ($planet > $config->game_maxPlanet && $target_mission != MT_EXPLORE))
31 31
     $errorlist .= $lang['fl_limit_planet'];
32 32
   if ($planetrow['galaxy'] == $galaxy && $planetrow['system'] == $system && $planetrow['planet'] == $planet && $planetrow['planet_type'] == $planet_type)
33 33
     $errorlist .= $lang['fl_ownpl_err'];
@@ -54,35 +54,35 @@  discard block
 block discarded – undo
54 54
   $planetrow = DBStaticPlanet::db_planet_by_id($planetrow['id'], true);
55 55
 
56 56
   if ($target_mission == MT_EXPLORE) {
57
-    if ($MaxExpeditions == 0 ) {
57
+    if ($MaxExpeditions == 0) {
58 58
       $errorlist .= $lang['fl_expe_notech'];
59
-    } elseif ($FlyingExpeditions >= $MaxExpeditions ) {
59
+    } elseif ($FlyingExpeditions >= $MaxExpeditions) {
60 60
       $errorlist .= $lang['fl_expe_max'];
61 61
     }
62 62
   } else {
63
-    if ($TargetPlanet['id_owner']){
63
+    if ($TargetPlanet['id_owner']) {
64 64
       if ($target_mission == MT_COLONIZE)
65 65
         $errorlist .= $lang['fl_colonized'];
66 66
 
67
-      if ($TargetPlanet['id_owner'] == $planetrow['id_owner']){
67
+      if ($TargetPlanet['id_owner'] == $planetrow['id_owner']) {
68 68
         if ($target_mission == MT_ATTACK)
69 69
           $errorlist .= $lang['fl_no_self_attack'];
70 70
 
71 71
         if ($target_mission == MT_SPY)
72 72
           $errorlist .= $lang['fl_no_self_spy'];
73
-      }else{
73
+      } else {
74 74
         if ($target_mission == MT_RELOCATE)
75 75
           $errorlist .= $lang['fl_only_stay_at_home'];
76 76
       }
77
-    }else{
78
-      if ($target_mission < MT_COLONIZE){
77
+    } else {
78
+      if ($target_mission < MT_COLONIZE) {
79 79
         $errorlist .= $lang['fl_unknow_target'];
80
-      }else{
80
+      } else {
81 81
         if ($target_mission == MT_DESTROY)
82 82
           $errorlist .= $lang['fl_nomoon'];
83 83
 
84
-        if ($target_mission == MT_RECYCLE){
85
-          if($TargetPlanet['debris_metal'] + $TargetPlanet['debris_crystal'] == 0)
84
+        if ($target_mission == MT_RECYCLE) {
85
+          if ($TargetPlanet['debris_metal'] + $TargetPlanet['debris_crystal'] == 0)
86 86
             $errorlist .= $lang['fl_nodebris'];
87 87
         }
88 88
       }
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
   }
91 91
 
92 92
 
93
-  if(is_object($captainModule = moduleCaptain()) && $captain_id = sys_get_param_id('captain_id')) {
93
+  if (is_object($captainModule = moduleCaptain()) && $captain_id = sys_get_param_id('captain_id')) {
94 94
     $captain = $captainModule->unit_captain_get($planetrow['id']);
95 95
 //      mrc_get_level($user, $planetrow, UNIT_CAPTAIN, true);
96
-    if(!$captain) {
96
+    if (!$captain) {
97 97
       $errorlist .= $lang['module_unit_captain_error_no_captain'];
98
-    } elseif($captain['unit_location_type'] == LOC_PLANET) {
99
-      if($target_mission == MT_RELOCATE && ($arriving_captain = mrc_get_level($user, $TargetPlanet, UNIT_CAPTAIN, true))) {
98
+    } elseif ($captain['unit_location_type'] == LOC_PLANET) {
99
+      if ($target_mission == MT_RELOCATE && ($arriving_captain = mrc_get_level($user, $TargetPlanet, UNIT_CAPTAIN, true))) {
100 100
         $errorlist .= $lang['module_unit_captain_error_captain_already_bound'];
101 101
       }
102 102
     } else {
@@ -120,13 +120,13 @@  discard block
 block discarded – undo
120 120
   $fleet_group = max(0, intval($_POST['fleet_group']));
121 121
   //But is it acs??
122 122
   //Well all acs fleets must have a fleet code.
123
-  if($fleet_group) {
123
+  if ($fleet_group) {
124 124
     //Also it must be mission type 2
125 125
     $target_mission = MT_AKS;
126 126
 
127 127
     //The co-ords must be the same as where the acs fleet is going.
128 128
     $target = "g{$galaxy}s{$system}p{$planet}t{$planet_type}";
129
-    if($_POST['acs_target_mr'] == $target) {
129
+    if ($_POST['acs_target_mr'] == $target) {
130 130
       //ACS attack must exist (if acs fleet has arrived this will also return false (2 checks in 1!!!)
131 131
       $aks = DbFleetStatic::dbAcsGetById($fleet_group);
132 132
       if (!$aks) {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     }
143 143
   }
144 144
   //Check that a failed acs attack isn't being sent, if it is, make it an attack fleet.
145
-  if(!$fleet_group && $target_mission == MT_AKS) {
145
+  if (!$fleet_group && $target_mission == MT_AKS) {
146 146
     $target_mission = MT_ATTACK;
147 147
   }
148 148
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
   $options = [P_FLEET_ATTACK_SPEED_PERCENT_TENTH => $speed_percent, P_FLEET_ATTACK_FLEET_GROUP => $fleet_group, P_FLEET_ATTACK_RESOURCES_SUM => $StorageNeeded];
153 153
   $cant_attack = flt_can_attack($planetrow, $TargetPlanet, $fleetarray, $target_mission, $options);
154 154
 
155
-  if($cant_attack !== ATTACK_ALLOWED) {
155
+  if ($cant_attack !== ATTACK_ALLOWED) {
156 156
     SnTemplate::messageBox("<span class='error'><b>{$lang['fl_attack_error'][$cant_attack]}</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 99);
157 157
   }
158 158
 
@@ -163,11 +163,10 @@  discard block
 block discarded – undo
163 163
 
164 164
   $fleet['start_time'] = $duration + SN_TIME_NOW;
165 165
 
166
-  $max_duration = $target_mission == MT_EXPLORE ? get_player_max_expedition_duration($user) :
167
-    ($target_mission == MT_HOLD ? 12 : 0);
168
-  if($max_duration) {
166
+  $max_duration = $target_mission == MT_EXPLORE ? get_player_max_expedition_duration($user) : ($target_mission == MT_HOLD ? 12 : 0);
167
+  if ($max_duration) {
169 168
     $StayDuration = sys_get_param_id('missiontime');
170
-    if($StayDuration > $max_duration || $StayDuration < 1) {
169
+    if ($StayDuration > $max_duration || $StayDuration < 1) {
171 170
       $debug->warning('Supplying wrong mission time', 'Hack attempt', 302, array('base_dump' => true));
172 171
       die();
173 172
     }
@@ -177,10 +176,10 @@  discard block
 block discarded – undo
177 176
     $StayDuration = 0;
178 177
     $StayTime     = 0;
179 178
   }
180
-  $fleet['end_time']   = $StayDuration + (2 * $duration) + SN_TIME_NOW;
179
+  $fleet['end_time'] = $StayDuration + (2 * $duration) + SN_TIME_NOW;
181 180
 
182
-  if($aks && $target_mission == MT_AKS) {
183
-    if ($fleet['start_time']>$aks['ankunft']) {
181
+  if ($aks && $target_mission == MT_AKS) {
182
+    if ($fleet['start_time'] > $aks['ankunft']) {
184 183
       SnTemplate::messageBox($lang['fl_aks_too_slow'] . 'Fleet arrival: ' . date(FMT_DATE_TIME, $fleet['start_time']) . " AKS arrival: " . date(FMT_DATE_TIME, $aks['ankunft']), $lang['fl_error']);
185 184
     }
186 185
     $fleet['start_time'] = $aks['ankunft'];
@@ -191,14 +190,14 @@  discard block
 block discarded – undo
191 190
   $FleetShipCount      = 0;
192 191
   $db_changeset = array();
193 192
   foreach ($fleetarray as $Ship => $Count) {
194
-    $FleetStorage    += get_unit_param($Ship, P_CAPACITY) * $Count;
193
+    $FleetStorage += get_unit_param($Ship, P_CAPACITY) * $Count;
195 194
     $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($Ship, -$Count, $user, $planetrow['id']);
196 195
   }
197 196
   $fleet_array = sys_unit_arr2str($fleetarray);
198
-  $FleetShipCount  += array_sum($fleetarray);
199
-  $FleetStorage        -= $consumption;
197
+  $FleetShipCount += array_sum($fleetarray);
198
+  $FleetStorage -= $consumption;
200 199
 
201
-  if ( $StorageNeeded > $FleetStorage) {
200
+  if ($StorageNeeded > $FleetStorage) {
202 201
     SnTemplate::messageBox("<span class='error'><b>" . $lang['fl_nostoragespa'] . HelperString::numberFloorAndFormat($StorageNeeded - $FleetStorage) . "</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
203 202
   }
204 203
   if ($planetrow['deuterium'] < $TransDeuterium + $consumption) {
@@ -247,7 +246,7 @@  discard block
 block discarded – undo
247 246
 //    ));
248 247
 //  }
249 248
 
250
-  if(is_array($captain)) {
249
+  if (is_array($captain)) {
251 250
     DBStaticUnit::db_unit_set_by_id($captain['unit_id'], "`unit_location_type` = " . LOC_FLEET . ", `unit_location_id` = {$fleet_id}");
252 251
   }
253 252
 
@@ -260,7 +259,7 @@  discard block
 block discarded – undo
260 259
     'START_LEFT'         => floor($fleet['end_time'] + 1 - SN_TIME_NOW),
261 260
   );
262 261
 
263
-  if(!empty($TargetPlanet)) {
262
+  if (!empty($TargetPlanet)) {
264 263
     $template_route += array(
265 264
       'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$TargetPlanet['planet_type']],
266 265
       'END_COORDS'       => uni_render_coordinates($TargetPlanet),
@@ -273,8 +272,8 @@  discard block
 block discarded – undo
273 272
   $template->assign_block_vars('fleets', $template_route);
274 273
 
275 274
   $sn_groups_fleet = sn_get_groups('fleet');
276
-  foreach($fleetarray as $ship_id => $ship_count) {
277
-    if(in_array($ship_id, $sn_groups_fleet) && $ship_count) {
275
+  foreach ($fleetarray as $ship_id => $ship_count) {
276
+    if (in_array($ship_id, $sn_groups_fleet) && $ship_count) {
278 277
 //      $ship_base_data = get_ship_data($ship_id, $user);
279 278
       $template->assign_block_vars('fleets.ships', array(
280 279
         'ID'          => $ship_id,
Please login to merge, or discard this patch.
includes/includes/flt_functions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
       return $result = ATTACK_ACS_TOO_LATE;
365 365
     }
366 366
 
367
-    if(DbFleetStatic::acsIsAcsFull($acs['id'])) {
367
+    if (DbFleetStatic::acsIsAcsFull($acs['id'])) {
368 368
       return $result = ATTACK_ACS_MAX_FLEETS;
369 369
     }
370 370
   }
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 
549 549
 
550 550
   !is_array($resources) ? $resources = [] : false;
551
-  if(empty($options[P_FLEET_ATTACK_RES_LIST])) {
551
+  if (empty($options[P_FLEET_ATTACK_RES_LIST])) {
552 552
     $options[P_FLEET_ATTACK_RES_LIST] = $resources;
553 553
   }
554 554
   $can_attack = flt_can_attack($from, $to, $fleet, $mission, $options);
Please login to merge, or discard this patch.