Test Failed
Push — trunk ( b76cfb...dfde47 )
by SuperNova.WS
03:49
created
includes/functions/int_fleet_events.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -8,23 +8,23 @@  discard block
 block discarded – undo
8 8
   $fleet_events = array();
9 9
   $fleet_number = 0;
10 10
 
11
-  if(empty($fleet_list))
11
+  if (empty($fleet_list))
12 12
   {
13 13
     return;
14 14
   }
15 15
 
16
-  foreach($fleet_list as $fleet)
16
+  foreach ($fleet_list as $fleet)
17 17
   {
18 18
     $planet_start_type = $fleet['fleet_start_type'] == PT_MOON ? PT_MOON : PT_PLANET;
19 19
     $planet_start = DBStaticPlanet::db_planet_by_gspt($fleet['fleet_start_galaxy'], $fleet['fleet_start_system'], $fleet['fleet_start_planet'], $planet_start_type, false, 'name');
20 20
     $fleet['fleet_start_name'] = $planet_start['name'];
21 21
 
22 22
     $planet_end_type = $fleet['fleet_end_type'] == PT_MOON ? PT_MOON : PT_PLANET;
23
-    if($fleet['fleet_end_planet'] > $config->game_maxPlanet)
23
+    if ($fleet['fleet_end_planet'] > $config->game_maxPlanet)
24 24
     {
25 25
       $fleet['fleet_end_name'] = $lang['ov_fleet_exploration'];
26 26
     }
27
-    elseif($fleet['fleet_mission'] == MT_COLONIZE)
27
+    elseif ($fleet['fleet_mission'] == MT_COLONIZE)
28 28
     {
29 29
       $fleet['fleet_end_name'] = $lang['ov_fleet_colonization'];
30 30
     }
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
       $fleet['fleet_end_name'] = $planet_end['name'];
35 35
     }
36 36
 
37
-    if($fleet['fleet_start_time'] > SN_TIME_NOW && $fleet['fleet_mess'] == 0 && $fleet['fleet_mission'] != MT_MISSILE &&
37
+    if ($fleet['fleet_start_time'] > SN_TIME_NOW && $fleet['fleet_mess'] == 0 && $fleet['fleet_mission'] != MT_MISSILE &&
38 38
       ($planet_scanned === false
39 39
         ||
40 40
         (
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
       $fleet_events[] = flt_register_fleet_event($fleet, 0, $planet_end_type);
50 50
     }
51 51
 
52
-    if($fleet['fleet_end_stay'] > SN_TIME_NOW && $fleet['fleet_mess'] == 0 && $planet_scanned === false && $fleet['fleet_mission'] != MT_MISSILE)
52
+    if ($fleet['fleet_end_stay'] > SN_TIME_NOW && $fleet['fleet_mess'] == 0 && $planet_scanned === false && $fleet['fleet_mission'] != MT_MISSILE)
53 53
     {
54 54
       $fleet_events[] = flt_register_fleet_event($fleet, 1, $planet_end_type);
55 55
     }
56 56
 
57
-    if(
57
+    if (
58 58
       $fleet['fleet_end_time'] > SN_TIME_NOW && $fleet['fleet_mission'] != MT_MISSILE && ($fleet['fleet_mess'] == 1 || ($fleet['fleet_mission'] != MT_RELOCATE && $fleet['fleet_mission'] != MT_COLONIZE)) &&
59 59
       (
60 60
         ($planet_scanned === false && $fleet['fleet_owner'] == $user['id'])
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
       $fleet_events[] = flt_register_fleet_event($fleet, 2, $planet_end_type);
72 72
     }
73 73
     
74
-    if($fleet['fleet_mission'] == MT_MISSILE)
74
+    if ($fleet['fleet_mission'] == MT_MISSILE)
75 75
     {
76 76
       $fleet_events[] = flt_register_fleet_event($fleet, 3, $planet_end_type);
77 77
     }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 {
85 85
   global $user, $planetrow, $fleet_number;
86 86
 
87
-  switch($fleet['ov_label'] = $ov_label)
87
+  switch ($fleet['ov_label'] = $ov_label)
88 88
   {
89 89
     case 0:
90 90
       $fleet['event_time'] = $fleet['fleet_start_time'];
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 
117 117
   }
118 118
 
119
-  $fleet['ov_this_planet'] = $is_this_planet;// || $planet_scanned != false;
119
+  $fleet['ov_this_planet'] = $is_this_planet; // || $planet_scanned != false;
120 120
 
121
-  if($fleet['fleet_owner'] == $user['id'])
121
+  if ($fleet['fleet_owner'] == $user['id'])
122 122
   {
123 123
     $user_data = $user;
124 124
   }
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.
classes/TextEntity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
    */
44 44
   public function toArray() {
45 45
     $tutorial = array();
46
-    foreach($this->keys() as $key) {
46
+    foreach ($this->keys() as $key) {
47 47
       $tutorial[$key] = $this->$key;
48 48
     }
49 49
 
Please login to merge, or discard this patch.
admin/adm_quest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@
 block discarded – undo
7 7
  *
8 8
  */
9 9
 
10
-define('INSIDE'  , true);
11
-define('INSTALL' , false);
12
-define('IN_ADMIN'  , true);
10
+define('INSIDE', true);
11
+define('INSTALL', false);
12
+define('IN_ADMIN', true);
13 13
 
14 14
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
15 15
 
Please login to merge, or discard this patch.
admin/adm_message_list.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@  discard block
 block discarded – undo
8 8
  *
9 9
  */
10 10
 
11
-define('INSIDE'  , true);
12
-define('INSTALL' , false);
11
+define('INSIDE', true);
12
+define('INSTALL', false);
13 13
 define('IN_ADMIN', true);
14 14
 
15 15
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
   ),
29 29
 );
30 30
 $template->assign_block_vars('int_type_selected', $allowed_types[-1]);
31
-foreach($sn_message_class_list as $key => $value)
31
+foreach ($sn_message_class_list as $key => $value)
32 32
 {
33
-  if($key == MSG_TYPE_NEW || $key == MSG_TYPE_OUTBOX)
33
+  if ($key == MSG_TYPE_NEW || $key == MSG_TYPE_OUTBOX)
34 34
   {
35 35
     continue;
36 36
   }
@@ -43,19 +43,19 @@  discard block
 block discarded – undo
43 43
 
44 44
 
45 45
 $message_delete = sys_get_param_id('msg_del');
46
-if(sys_get_param('str_delete_selected') && is_array($message_delete = sys_get_param('selected')) && !empty($message_delete))
46
+if (sys_get_param('str_delete_selected') && is_array($message_delete = sys_get_param('selected')) && !empty($message_delete))
47 47
 {
48 48
   $message_delete = implode(', ', $message_delete);
49 49
 }
50 50
 
51
-if($message_delete)
51
+if ($message_delete)
52 52
 {
53 53
   doquery("DELETE FROM {{messages}} WHERE `message_id` in ({$message_delete});");
54 54
   $template->assign_block_vars('result', array('MESSAGE' => sprintf($lang['mlst_messages_deleted'], $message_delete)));
55 55
 }
56 56
 
57 57
 
58
-if(sys_get_param('str_delete_date') && checkdate($month = sys_get_param_id('delete_month'), $day = sys_get_param_id('delete_day'), $year = sys_get_param_id('delete_year')))
58
+if (sys_get_param('str_delete_date') && checkdate($month = sys_get_param_id('delete_month'), $day = sys_get_param_id('delete_day'), $year = sys_get_param_id('delete_year')))
59 59
 {
60 60
   $delete_date = "{$year}-{$month}-{$day}";
61 61
   doquery("DELETE FROM {{messages}} WHERE message_time <= UNIX_TIMESTAMP('{$delete_date}')" . ($int_type_selected >= 0 ? " AND `message_type` = {$int_type_selected}" : ''));
@@ -68,16 +68,16 @@  discard block
 block discarded – undo
68 68
 
69 69
 $int_page_current = min(sys_get_param_id('int_page_current', 1), $page_max);
70 70
 
71
-if(sys_get_param('page_prev') && $int_page_current > 1)
71
+if (sys_get_param('page_prev') && $int_page_current > 1)
72 72
 {
73 73
   $int_page_current--;
74 74
 }
75
-elseif(sys_get_param('page_next') && $int_page_current < $page_max)
75
+elseif (sys_get_param('page_next') && $int_page_current < $page_max)
76 76
 {
77 77
   $int_page_current++;
78 78
 }
79 79
 
80
-for($i = 1; $i <= $page_max; $i++)
80
+for ($i = 1; $i <= $page_max; $i++)
81 81
 {
82 82
   $template->assign_block_vars('page', array('NUMBER' => $i));
83 83
 }
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 $StartRec = ($int_page_current - 1) * 25;
86 86
 
87 87
 $Messages = db_message_list_admin_by_type($int_type_selected, $StartRec);
88
-while($row = db_fetch($Messages))
88
+while ($row = db_fetch($Messages))
89 89
 {
90 90
   $row['FROM'] = htmlentities($row['FROM'], ENT_COMPAT, 'UTF-8');
91 91
   $row['OWNER_NAME'] = htmlentities($row['OWNER_NAME'], ENT_COMPAT, 'UTF-8');
Please login to merge, or discard this patch.
admin/adm_user_analyze.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -19,13 +19,13 @@  discard block
 block discarded – undo
19 19
 // define('SESSION_INTERRUPT', 15*60); // Можно увеличить до 4 часов - никито не может сидеть 2 суток с перерывом менее 4 часов
20 20
 // define('SUSPICIOUS_LONG', 2 * 60*60); // Тогда это увеличиваем до, скажем суток - и там смотрим
21 21
 
22
-define('SESSION_INTERRUPT', 1 * 60*60); // Можно увеличить до 4 часов - никито не может сидеть 2 суток с перерывом менее 4 часов
23
-define('SUSPICIOUS_LONG', 16 * 60*60); // Тогда это увеличиваем до, скажем суток - и там смотрим
22
+define('SESSION_INTERRUPT', 1 * 60 * 60); // Можно увеличить до 4 часов - никито не может сидеть 2 суток с перерывом менее 4 часов
23
+define('SUSPICIOUS_LONG', 16 * 60 * 60); // Тогда это увеличиваем до, скажем суток - и там смотрим
24 24
 
25 25
 
26 26
 function check_suspicious(&$session, &$session_list_last_id, &$row) {
27 27
   $session[2] = $session[1] - $session[0];
28
-  if($session[2] > SUSPICIOUS_LONG)
28
+  if ($session[2] > SUSPICIOUS_LONG)
29 29
   {
30 30
     $session[2] = pretty_time($session[2]);
31 31
     $session[0] = date(FMT_DATE_TIME_SQL, $session[0]);
@@ -46,24 +46,24 @@  discard block
 block discarded – undo
46 46
 $session_list = array();
47 47
 $query = doquery("SELECT `visit_time`, user_id FROM {{counter}} where user_id <> 0 and visit_time > UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 7 DAY)) order by user_id, visit_time;");
48 48
 $session = array();
49
-if($row = db_fetch($query)) {
49
+if ($row = db_fetch($query)) {
50 50
   $session = array(
51 51
     0 => strtotime($row['visit_time']), // start
52 52
     1 => strtotime($row['visit_time']), // end
53 53
   );
54 54
   $last_id = $row['user_id'];
55 55
 }
56
-while($row = db_fetch($query)) {
56
+while ($row = db_fetch($query)) {
57 57
   $row['visit_time'] = strtotime($row['visit_time']);
58
-  if($last_id == $row['user_id']) {
58
+  if ($last_id == $row['user_id']) {
59 59
     // Тот же юзер
60
-    if($row['visit_time'] - $session[1] <= SESSION_INTERRUPT) { // Та же сессия
60
+    if ($row['visit_time'] - $session[1] <= SESSION_INTERRUPT) { // Та же сессия
61 61
       $session[1] = $row['visit_time'];
62 62
     } else {
63 63
       // Новая сессия
64 64
 //      check_suspicious($session, $session_list[$last_id], $row);
65 65
       $session[2] = $session[1] - $session[0];
66
-      if($session[2] > SUSPICIOUS_LONG)
66
+      if ($session[2] > SUSPICIOUS_LONG)
67 67
       {
68 68
         $session[2] = pretty_time($session[2]);
69 69
         $session[0] = date(FMT_DATE_TIME_SQL, $session[0]);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
   } else {
79 79
 //    check_suspicious($session, $session_list[$last_id], $row);
80 80
     $session[2] = $session[1] - $session[0];
81
-      if($session[2] > SUSPICIOUS_LONG)
81
+      if ($session[2] > SUSPICIOUS_LONG)
82 82
       {
83 83
         $session[2] = pretty_time($session[2]);
84 84
         $session[0] = date(FMT_DATE_TIME_SQL, $session[0]);
@@ -93,11 +93,11 @@  discard block
 block discarded – undo
93 93
   }
94 94
 }
95 95
 
96
-if($last_id) {
96
+if ($last_id) {
97 97
   // check_suspicious($session, $session_list[$last_id], $row = array('time' => 0));
98 98
   $session[2] = $session[1] - $session[0];
99 99
 
100
-  if($session[2] > SUSPICIOUS_LONG)
100
+  if ($session[2] > SUSPICIOUS_LONG)
101 101
   {
102 102
     $session[2] = pretty_time($session[2]);
103 103
     $session[0] = date(FMT_DATE_TIME_SQL, $session[0]);
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
 print("<td>ID</td><td>Username</td><td>Start</td><td>End</td><td>Length</td>");
112 112
 print("<td>Last online</td>");
113 113
 print("</tr>");
114
-foreach($session_list as $user_id => $value) {
114
+foreach ($session_list as $user_id => $value) {
115 115
   $user_record = doquery("SELECT `username`, onlinetime FROM {{users}} WHERE id = {$user_id};", true);
116
-  foreach($value as $interval_data) {
116
+  foreach ($value as $interval_data) {
117 117
     print("<tr>");
118 118
     print("<td>{$user_id}</td><td>{$user_record['username']}</td><td>{$interval_data[0]}</td><td>{$interval_data[1]}</td><td>{$interval_data[2]}</td>");
119 119
     print("<td>" . date(FMT_DATE_TIME_SQL, $user_record['onlinetime']) . "</td>");
Please login to merge, or discard this patch.