Passed
Branch trunk (7dc288)
by SuperNova.WS
06:07
created
includes/includes/flt_mission_transport.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
   $source_planet      = &$mission_data['src_planet'];
15 15
   $destination_planet = &$mission_data['dst_planet'];
16 16
 
17
-  if(!isset($destination_planet['id']) || !$destination_planet['id_owner'])
17
+  if (!isset($destination_planet['id']) || !$destination_planet['id_owner'])
18 18
   {
19 19
     // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;");
20 20
     fleet_send_back($fleet_row);
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
     $destination_planet['name'], uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''),
28 28
     $fleet_row['fleet_resource_metal'], $lang['Metal'],
29 29
     $fleet_row['fleet_resource_crystal'], $lang['Crystal'],
30
-    $fleet_row['fleet_resource_deuterium'], $lang['Deuterium'] );
30
+    $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']);
31 31
   msg_send_simple_message($fleet_row['fleet_target_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
32 32
 
33
-  if($fleet_row['fleet_target_owner'] <> $fleet_row['fleet_owner'])
33
+  if ($fleet_row['fleet_target_owner'] <> $fleet_row['fleet_owner'])
34 34
   {
35 35
     msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message);
36 36
   }
Please login to merge, or discard this patch.
flotenajax.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -29,14 +29,14 @@  discard block
 block discarded – undo
29 29
   'planet' => $target_planet = sys_get_param_int('planet'),
30 30
 );
31 31
 
32
-if(!uni_coordinates_valid($target_coord))
32
+if (!uni_coordinates_valid($target_coord))
33 33
 {
34 34
   die($lang['gs_c02']);
35 35
 }
36 36
 
37 37
 $target_mission = sys_get_param_int('mission');
38 38
 $sn_group_missions = sn_get_groups('missions');
39
-if(!isset($sn_group_missions[$target_mission]['AJAX']) || !$sn_group_missions[$target_mission]['AJAX'])
39
+if (!isset($sn_group_missions[$target_mission]['AJAX']) || !$sn_group_missions[$target_mission]['AJAX'])
40 40
 {
41 41
   die($lang['gs_c00']);
42 42
 }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 $target_coord['planet_type'] = $target_planet_check;
53 53
 $target_row = DBStaticPlanet::db_planet_by_vector($target_coord);
54 54
 
55
-if(empty($target_row))
55
+if (empty($target_row))
56 56
 {
57 57
   $target_row = array(
58 58
     'galaxy' => $target_coord['galaxy'],
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 }
65 65
 
66 66
 $fleet_array = array();
67
-switch($target_mission)
67
+switch ($target_mission)
68 68
 {
69 69
   case MT_SPY:
70 70
     // $fleet_array[SHIP_SPY] = min(mrc_get_level($user, $planetrow, SHIP_SPY), abs($user['spio_anz']));
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
   break;
74 74
 
75 75
   case MT_RECYCLE:
76
-    foreach(sn_get_groups('flt_recyclers') as $unit_id)
76
+    foreach (sn_get_groups('flt_recyclers') as $unit_id)
77 77
     {
78
-      if($unit_count = mrc_get_level($user, $planetrow, $unit_id))
78
+      if ($unit_count = mrc_get_level($user, $planetrow, $unit_id))
79 79
       {
80 80
         $fleet_array[$unit_id] = $unit_count;
81 81
       }
@@ -96,14 +96,14 @@  discard block
 block discarded – undo
96 96
 $cant_attack = flt_can_attack($planetrow, $target_row, $fleet_array, $target_mission, $options);
97 97
 
98 98
 
99
-if($cant_attack != ATTACK_ALLOWED)
99
+if ($cant_attack != ATTACK_ALLOWED)
100 100
 {
101 101
   die($lang['fl_attack_error'][$cant_attack]);
102 102
 }
103 103
 
104
-$FleetDBArray   = array();
104
+$FleetDBArray = array();
105 105
 $db_changeset = array();
106
-foreach($fleet_array as $unit_id => $unit_count)
106
+foreach ($fleet_array as $unit_id => $unit_count)
107 107
 {
108 108
   $FleetDBArray[] = "{$unit_id},{$unit_count}";
109 109
   $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($unit_id, -$unit_count, $user, $planetrow);
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
 $fleet_ship_count = array_sum($fleet_array);
114 114
 
115
-if($target_mission == MT_MISSILE)
115
+if ($target_mission == MT_MISSILE)
116 116
 {
117 117
   $distance = abs($target_coord['system'] - $planetrow['system']);
118 118
   $duration = round((30 + (60 * $distance)) / flt_server_flight_speed_multiplier());
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 {
131 131
   $travel_data = flt_travel_data($user, $planetrow, $target_coord, $fleet_array, 10);
132 132
 
133
-  if($planetrow['deuterium'] < $travel_data['consumption'])
133
+  if ($planetrow['deuterium'] < $travel_data['consumption'])
134 134
   {
135 135
     die($lang['gs_c13']);
136 136
   }
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 $ships_sent = array();
190 190
 //$ships_sent_js = array();
191 191
 $ships_sent_js = 0;
192
-foreach($fleet_array as $unit_id => $unit_count)
192
+foreach ($fleet_array as $unit_id => $unit_count)
193 193
 {
194 194
   $ships_sent[] = "{$unit_count} {$lang['tech'][$unit_id]}";
195 195
   $ships_sent_js += mrc_get_level($user, $planetrow, $unit_id, false, true);
@@ -198,6 +198,6 @@  discard block
 block discarded – undo
198 198
 //$ships_sent_js = implode(',', $ships_sent_js);
199 199
 $ships_sent_js = "{$unit_group}={$ships_sent_js}";
200 200
 
201
-$ResultMessage  = "{$lang['gs_sending']} {$ships_sent} {$lang['gs_to']} {$target_coord['galaxy']}:{$target_coord['system']}:{$target_coord['planet']}|{$ships_sent_js}";
201
+$ResultMessage = "{$lang['gs_sending']} {$ships_sent} {$lang['gs_to']} {$target_coord['galaxy']}:{$target_coord['system']}:{$target_coord['planet']}|{$ships_sent_js}";
202 202
 
203 203
 die($ResultMessage);
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
@@ -5,14 +5,14 @@
 block discarded – undo
5 5
  */
6 6
 global $template;
7 7
 
8
-if(isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) {
8
+if (isset($sn_page_name) || ($sn_page_name = isset($_GET['page']) ? trim(strip_tags($_GET['page'])) : '')) {
9 9
   require_once('common.' . substr(strrchr(__FILE__, '.'), 1));
10
-  if($sn_page_name) {
10
+  if ($sn_page_name) {
11 11
     // Loading page-specific language files
12 12
 
13 13
     !empty($sn_mvc['model'][$sn_page_name]) and execute_hooks($sn_mvc['model'][$sn_page_name], $template, 'model', $sn_page_name);
14 14
     !empty($sn_mvc['view'][$sn_page_name]) and execute_hooks($sn_mvc['view'][$sn_page_name], $template, 'view', $sn_page_name);
15
-    if(!empty($template_result) && is_object($template)) {
15
+    if (!empty($template_result) && is_object($template)) {
16 16
       $template->assign_recursive($template_result);
17 17
     }
18 18
 
Please login to merge, or discard this patch.
classes/AjaxController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
     define('IN_AJAX', true);
23 23
 
24
-    if(!is_object($template)) {
24
+    if (!is_object($template)) {
25 25
       $template = gettemplate('_ajax', true);
26 26
     }
27 27
 
@@ -37,16 +37,16 @@  discard block
 block discarded – undo
37 37
 
38 38
     $mode = sys_get_param_str('mode');
39 39
 
40
-    if(class_exists($className = 'Pages\\Page' . ucfirst($mode))) {
40
+    if (class_exists($className = 'Pages\\Page' . ucfirst($mode))) {
41 41
       /**
42 42
        * @var \Pages\IPage $page
43 43
        */
44 44
       $page = new $className();
45
-      if(method_exists($page, 'loadParams')) {
45
+      if (method_exists($page, 'loadParams')) {
46 46
         $page->loadParams();
47 47
       }
48 48
 
49
-      if(method_exists($page, $action = sys_get_param('action')) && $page->checkAction($action)) {
49
+      if (method_exists($page, $action = sys_get_param('action')) && $page->checkAction($action)) {
50 50
         $result = $page->$action();
51 51
         is_array($result) ? HelperArray::merge($template_result['AJAX'], $result) : false;
52 52
       }
Please login to merge, or discard this patch.
classes/PTLTag.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     $this->raw = $stringTag;
50 50
 
51 51
     // Separating params - so there are will be no false-positives for template's variable names
52
-    if(strpos($this->raw, '|') !== false) {
52
+    if (strpos($this->raw, '|') !== false) {
53 53
       $this->params = explode('|', $this->raw);
54 54
       $this->resolved = $this->params[0];
55 55
       unset($this->params[0]);
Please login to merge, or discard this patch.
classes/Pages/PageQuest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
       QUEST_STATUS_COMPLETE => '',
32 32
     );
33 33
 
34
-    if(!isset($statuses[$this->filterQuestStatus])) {
34
+    if (!isset($statuses[$this->filterQuestStatus])) {
35 35
       $this->filterQuestStatus = QUEST_STATUS_ALL;
36 36
     }
37 37
   }
Please login to merge, or discard this patch.
classes/TextModel.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
       }
102 102
     }
103 103
 
104
-    if(!isset($next)) {
104
+    if (!isset($next)) {
105 105
       $next = new TextEntity();
106 106
     }
107 107
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
       $prev = $this->getById($currentText->prev);
120 120
     }
121 121
 
122
-    if(!isset($prev)) {
122
+    if (!isset($prev)) {
123 123
       $prev = new TextEntity();
124 124
     }
125 125
 
Please login to merge, or discard this patch.
classes/template.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
   {
87 87
     global $user;
88 88
 
89
-    if (file_exists($this->rootPhysical. 'styles/' . $user->theme['template_path'] . '/template'))
89
+    if (file_exists($this->rootPhysical . 'styles/' . $user->theme['template_path'] . '/template'))
90 90
     {
91 91
       $this->root = $this->rootPhysical . 'styles/' . $user->theme['template_path'] . '/template';
92 92
       $this->cachepath = $this->rootPhysical . 'cache/tpl_' . str_replace('_', '-', $user->theme['template_path']) . '_';
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
       // Re-position template blocks
646 646
       for ($i = sizeof($this->_tpldata[$blockname]); $i > $key; $i--)
647 647
       {
648
-        $this->_tpldata[$blockname][$i] = $this->_tpldata[$blockname][$i-1];
648
+        $this->_tpldata[$blockname][$i] = $this->_tpldata[$blockname][$i - 1];
649 649
         $this->_tpldata[$blockname][$i]['S_ROW_COUNT'] = $i;
650 650
       }
651 651
 
@@ -725,13 +725,13 @@  discard block
 block discarded – undo
725 725
   */
726 726
   function assign_recursive($values, $name = '')
727 727
   {
728
-    if(isset($values['.']))
728
+    if (isset($values['.']))
729 729
     {
730 730
       $values_extra = $values['.'];
731 731
       unset($values['.']);
732 732
     }
733 733
 
734
-    if(!$name)
734
+    if (!$name)
735 735
     {
736 736
       $this->assign_vars($values);
737 737
     }
@@ -740,12 +740,12 @@  discard block
 block discarded – undo
740 740
       $this->assign_block_vars($name, $values);
741 741
     }
742 742
 
743
-    if(isset($values_extra))
743
+    if (isset($values_extra))
744 744
     {
745
-      foreach($values_extra as $sub_array_name => $sub_array)
745
+      foreach ($values_extra as $sub_array_name => $sub_array)
746 746
       {
747 747
         $new_name = $name . ($name ? '.' : '') . $sub_array_name;
748
-        foreach($sub_array as $sub_element)
748
+        foreach ($sub_array as $sub_element)
749 749
         {
750 750
           $this->assign_recursive($sub_element, $new_name);
751 751
         }
Please login to merge, or discard this patch.
classes/DBAL/DbQuery.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
    * @return string
339 339
    */
340 340
   protected function stringValue($value) {
341
-    return "'" . $this->escape((string)$value) . "'";
341
+    return "'" . $this->escape((string) $value) . "'";
342 342
   }
343 343
 
344 344
   /**
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
    * @return string
350 350
    */
351 351
   public function quote($fieldName) {
352
-    return "`" . $this->escape((string)$fieldName) . "`";
352
+    return "`" . $this->escape((string) $fieldName) . "`";
353 353
   }
354 354
 
355 355
   /**
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
    * @return string
397 397
    */
398 398
   protected function quoteTable($tableName) {
399
-    return "`{{" . $this->escape((string)$tableName) . "}}`";
399
+    return "`{{" . $this->escape((string) $tableName) . "}}`";
400 400
   }
401 401
 
402 402
   /**
Please login to merge, or discard this patch.