Test Failed
Push — trunk ( b76cfb...dfde47 )
by SuperNova.WS
03:49
created
includes/general/general_pname.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,12 +2,10 @@
 block discarded – undo
2 2
 
3 3
 // Эти функции будут переписаны по добавлению инфы в БД
4 4
 
5
-function pname_factory_production_field_name($factory_unit_id)
6
-{
5
+function pname_factory_production_field_name($factory_unit_id) {
7 6
   return get_unit_param($factory_unit_id, P_NAME) . '_porcent';
8 7
 }
9 8
 
10
-function pname_resource_name($resource_id)
11
-{
9
+function pname_resource_name($resource_id) {
12 10
   return get_unit_param($resource_id, P_NAME);
13 11
 }
14 12
\ No newline at end of file
Please login to merge, or discard this patch.
includes/includes/flt_mission_hold.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,7 @@
 block discarded – undo
2 2
 
3 3
 use Fleet\DbFleetStatic;
4 4
 
5
-function flt_mission_hold(&$mission_data)
6
-{
5
+function flt_mission_hold(&$mission_data) {
7 6
   if($mission_data['fleet']['fleet_end_stay'] < SN_TIME_NOW)
8 7
   {
9 8
     DbFleetStatic::fleet_send_back($mission_data['fleet']);
Please login to merge, or discard this patch.
includes/includes/flt_page3.inc 1 patch
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.
classes/template_compile.php 1 patch
Braces   +33 added lines, -66 removed lines patch added patch discarded remove patch
@@ -37,8 +37,7 @@  discard block
 block discarded – undo
37 37
 *
38 38
 * @package phpBB3
39 39
 */
40
-class template_compile
41
-{
40
+class template_compile {
42 41
   var $template;
43 42
 
44 43
   // Various storage arrays
@@ -58,8 +57,7 @@  discard block
 block discarded – undo
58 57
   * Load template source from file
59 58
   * @access private
60 59
   */
61
-  function _tpl_load_file($handle, $store_in_db = false)
62
-  {
60
+  function _tpl_load_file($handle, $store_in_db = false) {
63 61
     // Try and open template for read
64 62
     if (!file_exists($this->template->files[$handle]))
65 63
     {
@@ -69,8 +67,7 @@  discard block
 block discarded – undo
69 67
 
70 68
         return;
71 69
         trigger_error("template->_tpl_load_file(): File {$this->template->files[$handle]} does not exist or is empty", E_USER_ERROR);
72
-      }
73
-      else
70
+      } else
74 71
       {
75 72
         $this->template->files[$handle] = $this->template->files_inherit[$handle];
76 73
       }
@@ -106,8 +103,7 @@  discard block
 block discarded – undo
106 103
   * the ones that exist in zend_language_scanner.l
107 104
   * @access private
108 105
   */
109
-  function remove_php_tags(&$code)
110
-  {
106
+  function remove_php_tags(&$code) {
111 107
     // This matches the information gathered from the internal PHP lexer
112 108
     $match = array(
113 109
       '#<([\?%])=?.*?\1>#s',
@@ -122,8 +118,7 @@  discard block
 block discarded – undo
122 118
   * The all seeing all doing compile method. Parts are inspired by or directly from Smarty
123 119
   * @access private
124 120
   */
125
-  function compile($code, $no_echo = false, $echo_var = '')
126
-  {
121
+  function compile($code, $no_echo = false, $echo_var = '') {
127 122
     if ($echo_var)
128 123
     {
129 124
       global $$echo_var;
@@ -226,15 +221,13 @@  discard block
 block discarded – undo
226 221
               $var = substr($temp, 2, -1);
227 222
               //$file = $this->template->_tpldata['DEFINE']['.'][$var];
228 223
               $temp = "\$this->_tpldata['DEFINE']['.']['$var']";
229
-            }
230
-            else
224
+            } else
231 225
             {
232 226
               $var = substr($temp, 1, -1);
233 227
               //$file = $this->template->_rootref[$var];
234 228
               $temp = "\$this->_rootref['$var']";
235 229
             }
236
-          }
237
-          else
230
+          } else
238 231
           {
239 232
             $file = $temp;
240 233
           }
@@ -293,8 +286,7 @@  discard block
 block discarded – undo
293 286
   * Compile variables
294 287
   * @access private
295 288
   */
296
-  function compile_var_tags(&$text_blocks)
297
-  {
289
+  function compile_var_tags(&$text_blocks) {
298 290
     // including $lang variable
299 291
     // global $lang, $config; // NOT NEDEED - $lang now is global!
300 292
 
@@ -368,8 +360,7 @@  discard block
 block discarded – undo
368 360
   * Compile blocks
369 361
   * @access private
370 362
   */
371
-  function compile_tag_block($tag_args)
372
-  {
363
+  function compile_tag_block($tag_args) {
373 364
     $no_nesting = false;
374 365
 
375 366
     // Is the designer wanting to call another loop in a loop?
@@ -392,8 +383,7 @@  discard block
 block discarded – undo
392 383
       if ($match[2] < 0)
393 384
       {
394 385
         $loop_start = '($_' . $tag_args . '_count ' . $match[2] . ' < 0 ? 0 : $_' . $tag_args . '_count ' . $match[2] . ')';
395
-      }
396
-      else
386
+      } else
397 387
       {
398 388
         $loop_start = '($_' . $tag_args . '_count < ' . $match[2] . ' ? $_' . $tag_args . '_count : ' . $match[2] . ')';
399 389
       }
@@ -401,17 +391,14 @@  discard block
 block discarded – undo
401 391
       if (strlen($match[3]) < 1 || $match[3] == -1)
402 392
       {
403 393
         $loop_end = '$_' . $tag_args . '_count';
404
-      }
405
-      else if ($match[3] >= 0)
394
+      } else if ($match[3] >= 0)
406 395
       {
407 396
         $loop_end = '(' . ($match[3] + 1) . ' > $_' . $tag_args . '_count ? $_' . $tag_args . '_count : ' . ($match[3] + 1) . ')';
408
-      }
409
-      else //if ($match[3] < -1)
397
+      } else //if ($match[3] < -1)
410 398
       {
411 399
         $loop_end = '$_' . $tag_args . '_count' . ($match[3] + 1);
412 400
       }
413
-    }
414
-    else
401
+    } else
415 402
     {
416 403
       $loop_start = 0;
417 404
       $loop_end = '$_' . $tag_args . '_count';
@@ -424,8 +411,7 @@  discard block
 block discarded – undo
424 411
     {
425 412
       // We need to implode $no_nesting times from the end...
426 413
       $block = array_slice($this->block_names, -$no_nesting);
427
-    }
428
-    else
414
+    } else
429 415
     {
430 416
       $block = $this->block_names;
431 417
     }
@@ -435,8 +421,7 @@  discard block
 block discarded – undo
435 421
       // Block is not nested.
436 422
       $tag_template_php = '$_' . $tag_args . "_count = (isset(\$this->_tpldata['$tag_args'])) ? sizeof(\$this->_tpldata['$tag_args']) : 0;";
437 423
       $varref = "\$this->_tpldata['$tag_args']";
438
-    }
439
-    else
424
+    } else
440 425
     {
441 426
       // This block is nested.
442 427
       // Generate a namespace string for this block.
@@ -475,8 +460,7 @@  discard block
 block discarded – undo
475 460
   * some adaptions for our block level methods
476 461
   * @access private
477 462
   */
478
-  function compile_tag_if($tag_args, $elseif)
479
-  {
463
+  function compile_tag_if($tag_args, $elseif) {
480 464
     // Tokenize args for 'if' tag.
481 465
     preg_match_all('/(?:
482 466
       "[^"\\\\]*(?:\\\\.[^"\\\\]*)*"         |
@@ -584,8 +568,7 @@  discard block
 block discarded – undo
584 568
           if (preg_match('#^((?:[a-z0-9\-_]+\.)+)?(\$)?(?=[A-Za-z])([A-Za-z0-9\-_]+)#s', $token, $varrefs))
585 569
           {
586 570
             $token = (!empty($varrefs[1])) ? $this->generate_block_data_ref(substr($varrefs[1], 0, -1), true, $varrefs[2]) . '[\'' . $varrefs[3] . '\']' : (($varrefs[2]) ? '$this->_tpldata[\'DEFINE\'][\'.\'][\'' . $varrefs[3] . '\']' : '$this->_rootref[\'' . $varrefs[3] . '\']');
587
-          }
588
-          else if (preg_match('#^\.((?:[a-z0-9\-_]+\.?)+)$#s', $token, $varrefs))
571
+          } else if (preg_match('#^\.((?:[a-z0-9\-_]+\.?)+)$#s', $token, $varrefs))
589 572
           {
590 573
             // Allow checking if loops are set with .loopname
591 574
             // It is also possible to check the loop count by doing <!-- IF .loopname > 1 --> for example
@@ -601,8 +584,7 @@  discard block
 block discarded – undo
601 584
 
602 585
               // Add the block reference for the last child.
603 586
               $varref .= "['" . $block . "']";
604
-            }
605
-            else
587
+            } else
606 588
             {
607 589
               $varref = '$this->_tpldata';
608 590
 
@@ -610,8 +592,7 @@  discard block
 block discarded – undo
610 592
               $varref .= "['" . $blocks[0] . "']";
611 593
             }
612 594
             $token = "sizeof($varref)";
613
-          }
614
-          else if (!empty($token))
595
+          } else if (!empty($token))
615 596
           {
616 597
             $token = '(' . $token . ')';
617 598
           }
@@ -632,8 +613,7 @@  discard block
 block discarded – undo
632 613
   * Compile DEFINE tags
633 614
   * @access private
634 615
   */
635
-  function compile_tag_define($tag_args, $op)
636
-  {
616
+  function compile_tag_define($tag_args, $op) {
637 617
     preg_match('#^((?:[a-z0-9\-_]+\.)+)?\$(?=[A-Z])([A-Z0-9_\-]*)(?: = (\'?)([^\']*)(\'?))?$#', $tag_args, $match);
638 618
 
639 619
     if (empty($match[2]) || (!isset($match[4]) && $op))
@@ -656,8 +636,7 @@  discard block
 block discarded – undo
656 636
 
657 637
       // Now replace the php code
658 638
       $match[4] = "'" . str_replace(array('<?php echo ', '; ?>'), array("' . ", " . '"), $match[4]) . "'";
659
-    }
660
-    else
639
+    } else
661 640
     {
662 641
       preg_match('#true|false|\.#i', $match[4], $type);
663 642
 
@@ -685,8 +664,7 @@  discard block
 block discarded – undo
685 664
   * Compile INCLUDE tag
686 665
   * @access private
687 666
   */
688
-  function compile_tag_include($tag_args)
689
-  {
667
+  function compile_tag_include($tag_args) {
690 668
     // Process dynamic includes
691 669
     if ($tag_args[0] == '$')
692 670
     {
@@ -700,8 +678,7 @@  discard block
 block discarded – undo
700 678
   * Compile INCLUDE_PHP tag
701 679
   * @access private
702 680
   */
703
-  function compile_tag_include_php($tag_args)
704
-  {
681
+  function compile_tag_include_php($tag_args) {
705 682
     return "\$this->_php_include('$tag_args');";
706 683
   }
707 684
 
@@ -710,8 +687,7 @@  discard block
 block discarded – undo
710 687
   * This is from Smarty
711 688
   * @access private
712 689
   */
713
-  function _parse_is_expr($is_arg, $tokens)
714
-  {
690
+  function _parse_is_expr($is_arg, $tokens) {
715 691
     $expr_end = 0;
716 692
     $negate_expr = false;
717 693
 
@@ -719,8 +695,7 @@  discard block
 block discarded – undo
719 695
     {
720 696
       $negate_expr = true;
721 697
       $expr_type = array_shift($tokens);
722
-    }
723
-    else
698
+    } else
724 699
     {
725 700
       $expr_type = $first_token;
726 701
     }
@@ -733,8 +708,7 @@  discard block
 block discarded – undo
733 708
           $expr_end++;
734 709
           $expr_arg = $tokens[$expr_end++];
735 710
           $expr = "!(($is_arg / $expr_arg) % $expr_arg)";
736
-        }
737
-        else
711
+        } else
738 712
         {
739 713
           $expr = "!($is_arg & 1)";
740 714
         }
@@ -746,8 +720,7 @@  discard block
 block discarded – undo
746 720
           $expr_end++;
747 721
           $expr_arg = $tokens[$expr_end++];
748 722
           $expr = "(($is_arg / $expr_arg) % $expr_arg)";
749
-        }
750
-        else
723
+        } else
751 724
         {
752 725
           $expr = "($is_arg & 1)";
753 726
         }
@@ -786,8 +759,7 @@  discard block
 block discarded – undo
786 759
    *
787 760
    * @return string
788 761
    */
789
-  private function generate_block_varref($namespace, $varname, $defop = false)
790
-  {
762
+  private function generate_block_varref($namespace, $varname, $defop = false) {
791 763
     // Strip the trailing period.
792 764
     $namespace = substr($namespace, 0, -1);
793 765
 
@@ -810,8 +782,7 @@  discard block
 block discarded – undo
810 782
   * NOTE: does not expect a trailing "." on the blockname.
811 783
   * @access private
812 784
   */
813
-  function generate_block_data_ref($blockname, $include_last_iterator, $defop = false)
814
-  {
785
+  function generate_block_data_ref($blockname, $include_last_iterator, $defop = false) {
815 786
     // Get an array of the blocks involved.
816 787
     $blocks = explode('.', $blockname);
817 788
     $blockcount = sizeof($blocks) - 1;
@@ -833,12 +804,10 @@  discard block
 block discarded – undo
833 804
         $varref .= '[$_' . $blocks[$blockcount] . '_i]';
834 805
       }
835 806
       return $varref;
836
-    }
837
-    else if ($include_last_iterator)
807
+    } else if ($include_last_iterator)
838 808
     {
839 809
       return '$_'. $blocks[$blockcount] . '_val';
840
-    }
841
-    else
810
+    } else
842 811
     {
843 812
       return '$_'. $blocks[$blockcount - 1] . '_val[\''. $blocks[$blockcount]. '\']';
844 813
     }
@@ -848,8 +817,7 @@  discard block
 block discarded – undo
848 817
   * Write compiled file to cache directory
849 818
   * @access private
850 819
   */
851
-  function compile_write($handle, $data)
852
-  {
820
+  function compile_write($handle, $data) {
853 821
     $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . DOT_PHP_EX;
854 822
 
855 823
     $data = "<?php if (!defined('INSIDE')) exit;" . ((strpos($data, '<?php') === 0) ? substr($data, 5) : ' ?>' . $data);
@@ -873,8 +841,7 @@  discard block
 block discarded – undo
873 841
   * Minifies template w/i PHP code by removing extra spaces
874 842
   * @access private
875 843
   */
876
-  function minify($html)
877
-  {
844
+  function minify($html) {
878 845
     if(!SN::$config->tpl_minifier)
879 846
     {
880 847
       return $html;
Please login to merge, or discard this patch.
admin/adm_log_main.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,12 +21,10 @@  discard block
 block discarded – undo
21 21
 if($delete = sys_get_param_id('delete'))
22 22
 {
23 23
   doquery("DELETE FROM `{{logs}}` WHERE `log_id` = {$delete} LIMIT 1;");
24
-}
25
-elseif(sys_get_param_str('delete_update_info'))
24
+} elseif(sys_get_param_str('delete_update_info'))
26 25
 {
27 26
   doquery("DELETE FROM `{{logs}}` WHERE `log_code` in (103, 180, 191);");
28
-}
29
-elseif(sys_get_param_str('deleteall') == 'yes')
27
+} elseif(sys_get_param_str('deleteall') == 'yes')
30 28
 {
31 29
 //  doquery("TRUNCATE TABLE `{{logs}}`");
32 30
 }
@@ -50,8 +48,7 @@  discard block
 block discarded – undo
50 48
     }
51 49
   }
52 50
   $template->assign_vars($errorInfo);
53
-}
54
-else
51
+} else
55 52
 {
56 53
   $template = SnTemplate::gettemplate('admin/adm_log_main', true);
57 54
 
Please login to merge, or discard this patch.
admin/statbuilder.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,8 +37,7 @@
 block discarded – undo
37 37
   </script>';
38 38
 
39 39
   SnTemplate::messageBoxAdmin("{$script}<img src=\"design/images/progressbar.gif\"><br>{$lang['sys_wait']}", $lang['adm_stat_title'], '', 0);
40
-}
41
-else
40
+} else
42 41
 {
43 42
   SnTemplate::messageBoxAdmin($lang['adm_stat_already_started'], $lang['adm_stat_title'], 'admin/overview.php');
44 43
 }
Please login to merge, or discard this patch.
admin/adm_user_stat.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,7 @@
 block discarded – undo
13 13
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
14 14
 
15 15
 
16
-function admin_date_sort($a, $b)
17
-{
16
+function admin_date_sort($a, $b) {
18 17
   return $a['DATE'] == $b['DATE'] ? 0 : ($a['DATE'] > $b['DATE'] ? 1 : -1);
19 18
 }
20 19
 
Please login to merge, or discard this patch.
language/en/alliance.mo.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,9 @@
 block discarded – undo
26 26
 * DO NOT CHANGE
27 27
 */
28 28
 
29
-if (!defined('INSIDE')) die();
29
+if (!defined('INSIDE')) {
30
+  die();
31
+}
30 32
 
31 33
 
32 34
 $a_lang_array = [
Please login to merge, or discard this patch.
language/en/options.mo.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,9 @@
 block discarded – undo
25 25
 * DO NOT CHANGE
26 26
 */
27 27
 
28
-if (!defined('INSIDE')) die();
28
+if (!defined('INSIDE')) {
29
+  die();
30
+}
29 31
 
30 32
 $a_lang_array = [
31 33
   'opt_account' => 'Account',
Please login to merge, or discard this patch.