Test Failed
Push — trunk ( e02d87...314b8c )
by SuperNova.WS
07:20
created
classes/General/Helpers/URLHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
       }
20 20
     }
21 21
 
22
-    if(!empty($paramList)) {
22
+    if (!empty($paramList)) {
23 23
       $strParams = implode('&', $paramList);
24 24
     }
25 25
 
Please login to merge, or discard this patch.
classes/Common/Pimple/ServiceProviderInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@
 block discarded – undo
32 32
  * @author  Fabien Potencier
33 33
  * @author  Dominik Zogg
34 34
  */
35
-interface ServiceProviderInterface
36
-{
35
+interface ServiceProviderInterface {
37 36
     /**
38 37
      * Registers services on the given container.
39 38
      *
Please login to merge, or discard this patch.
classes/Common/Pimple/Container.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -239,7 +239,7 @@
 block discarded – undo
239 239
 
240 240
         $factory = $this->values[$id];
241 241
 
242
-        $extended = function ($c) use ($callable, $factory) {
242
+        $extended = function($c) use ($callable, $factory) {
243 243
             return $callable($factory($c), $c);
244 244
         };
245 245
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -24 removed lines patch added patch discarded remove patch
@@ -31,8 +31,7 @@  discard block
 block discarded – undo
31 31
  *
32 32
  * @author  Fabien Potencier
33 33
  */
34
-class Container implements \ArrayAccess
35
-{
34
+class Container implements \ArrayAccess {
36 35
     private $values = array();
37 36
     private $factories;
38 37
     private $protected;
@@ -47,8 +46,7 @@  discard block
 block discarded – undo
47 46
      *
48 47
      * @param array $values The parameters or objects.
49 48
      */
50
-    public function __construct(array $values = array())
51
-    {
49
+    public function __construct(array $values = array()) {
52 50
         $this->factories = new \SplObjectStorage();
53 51
         $this->protected = new \SplObjectStorage();
54 52
 
@@ -71,8 +69,7 @@  discard block
 block discarded – undo
71 69
      *
72 70
      * @throws \RuntimeException Prevent override of a frozen service
73 71
      */
74
-    public function offsetSet($id, $value)
75
-    {
72
+    public function offsetSet($id, $value) {
76 73
         if (isset($this->frozen[$id])) {
77 74
             throw new \RuntimeException(sprintf('Cannot override frozen service "%s".', $id));
78 75
         }
@@ -90,8 +87,7 @@  discard block
 block discarded – undo
90 87
      *
91 88
      * @throws \InvalidArgumentException if the identifier is not defined
92 89
      */
93
-    public function offsetGet($id)
94
-    {
90
+    public function offsetGet($id) {
95 91
         if (!isset($this->keys[$id])) {
96 92
             throw new \InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $id));
97 93
         }
@@ -125,8 +121,7 @@  discard block
 block discarded – undo
125 121
      *
126 122
      * @return bool
127 123
      */
128
-    public function offsetExists($id)
129
-    {
124
+    public function offsetExists($id) {
130 125
         return isset($this->keys[$id]);
131 126
     }
132 127
 
@@ -135,8 +130,7 @@  discard block
 block discarded – undo
135 130
      *
136 131
      * @param string $id The unique identifier for the parameter or object
137 132
      */
138
-    public function offsetUnset($id)
139
-    {
133
+    public function offsetUnset($id) {
140 134
         if (isset($this->keys[$id])) {
141 135
             if (is_object($this->values[$id])) {
142 136
                 unset($this->factories[$this->values[$id]], $this->protected[$this->values[$id]]);
@@ -155,8 +149,7 @@  discard block
 block discarded – undo
155 149
      *
156 150
      * @throws \InvalidArgumentException Service definition has to be a closure of an invokable object
157 151
      */
158
-    public function factory($callable)
159
-    {
152
+    public function factory($callable) {
160 153
         if (!method_exists($callable, '__invoke')) {
161 154
             throw new \InvalidArgumentException('Service definition is not a Closure or invokable object.');
162 155
         }
@@ -177,8 +170,7 @@  discard block
 block discarded – undo
177 170
      *
178 171
      * @throws \InvalidArgumentException Service definition has to be a closure of an invokable object
179 172
      */
180
-    public function protect($callable)
181
-    {
173
+    public function protect($callable) {
182 174
         if (!method_exists($callable, '__invoke')) {
183 175
             throw new \InvalidArgumentException('Callable is not a Closure or invokable object.');
184 176
         }
@@ -197,8 +189,7 @@  discard block
 block discarded – undo
197 189
      *
198 190
      * @throws \InvalidArgumentException if the identifier is not defined
199 191
      */
200
-    public function raw($id)
201
-    {
192
+    public function raw($id) {
202 193
         if (!isset($this->keys[$id])) {
203 194
             throw new \InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $id));
204 195
         }
@@ -223,8 +214,7 @@  discard block
 block discarded – undo
223 214
      *
224 215
      * @throws \InvalidArgumentException if the identifier is not defined or not a service definition
225 216
      */
226
-    public function extend($id, $callable)
227
-    {
217
+    public function extend($id, $callable) {
228 218
         if (!isset($this->keys[$id])) {
229 219
             throw new \InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $id));
230 220
         }
@@ -256,8 +246,7 @@  discard block
 block discarded – undo
256 246
      *
257 247
      * @return array An array of value names
258 248
      */
259
-    public function keys()
260
-    {
249
+    public function keys() {
261 250
         return array_keys($this->values);
262 251
     }
263 252
 
@@ -269,8 +258,7 @@  discard block
 block discarded – undo
269 258
      *
270 259
      * @return static
271 260
      */
272
-    public function register(ServiceProviderInterface $provider, array $values = array())
273
-    {
261
+    public function register(ServiceProviderInterface $provider, array $values = array()) {
274 262
         $provider->register($this);
275 263
 
276 264
         foreach ($values as $key => $value) {
Please login to merge, or discard this patch.
classes/template_compile.php 3 patches
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
   }
56 56
 
57 57
   /**
58
-  * Load template source from file
59
-  * @access private
60
-  */
58
+   * Load template source from file
59
+   * @access private
60
+   */
61 61
   function _tpl_load_file($handle, $store_in_db = false)
62 62
   {
63 63
     // Try and open template for read
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
   }
101 101
 
102 102
   /**
103
-  * Remove any PHP tags that do not belong, these regular expressions are derived from
104
-  * the ones that exist in zend_language_scanner.l
105
-  * @access private
106
-  */
103
+   * Remove any PHP tags that do not belong, these regular expressions are derived from
104
+   * the ones that exist in zend_language_scanner.l
105
+   * @access private
106
+   */
107 107
   function remove_php_tags(&$code)
108 108
   {
109 109
     // This matches the information gathered from the internal PHP lexer
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
   }
118 118
 
119 119
   /**
120
-  * The all seeing all doing compile method. Parts are inspired by or directly from Smarty
121
-  * @access private
122
-  */
120
+   * The all seeing all doing compile method. Parts are inspired by or directly from Smarty
121
+   * @access private
122
+   */
123 123
   function compile($code, $no_echo = false, $echo_var = '')
124 124
   {
125 125
     if ($echo_var)
@@ -288,9 +288,9 @@  discard block
 block discarded – undo
288 288
   }
289 289
 
290 290
   /**
291
-  * Compile variables
292
-  * @access private
293
-  */
291
+   * Compile variables
292
+   * @access private
293
+   */
294 294
   function compile_var_tags(&$text_blocks)
295 295
   {
296 296
     // including $lang variable
@@ -363,9 +363,9 @@  discard block
 block discarded – undo
363 363
   }
364 364
 
365 365
   /**
366
-  * Compile blocks
367
-  * @access private
368
-  */
366
+   * Compile blocks
367
+   * @access private
368
+   */
369 369
   function compile_tag_block($tag_args)
370 370
   {
371 371
     $no_nesting = false;
@@ -451,14 +451,14 @@  discard block
 block discarded – undo
451 451
     $tag_template_php .= 'if ($_' . $tag_args . '_count) {';
452 452
 
453 453
     /**
454
-    * The following uses foreach for iteration instead of a for loop, foreach is faster but requires PHP to make a copy of the contents of the array which uses more memory
455
-    * <code>
456
-    * if (!$offset)
457
-    * {
458
-    *   $tag_template_php .= 'foreach (' . $varref . ' as $_' . $tag_args . '_i => $_' . $tag_args . '_val){';
459
-    * }
460
-    * </code>
461
-    */
454
+     * The following uses foreach for iteration instead of a for loop, foreach is faster but requires PHP to make a copy of the contents of the array which uses more memory
455
+     * <code>
456
+     * if (!$offset)
457
+     * {
458
+     *   $tag_template_php .= 'foreach (' . $varref . ' as $_' . $tag_args . '_i => $_' . $tag_args . '_val){';
459
+     * }
460
+     * </code>
461
+     */
462 462
 
463 463
     $tag_template_php .= 'for ($_' . $tag_args . '_i = ' . $loop_start . '; $_' . $tag_args . '_i < ' . $loop_end . '; ++$_' . $tag_args . '_i){';
464 464
 //    $tag_template_php .= '$this->_block_counter["'. $tag_args . '"] = $_' . $tag_args . '_i;';
@@ -469,10 +469,10 @@  discard block
 block discarded – undo
469 469
   }
470 470
 
471 471
   /**
472
-  * Compile IF tags - much of this is from Smarty with
473
-  * some adaptions for our block level methods
474
-  * @access private
475
-  */
472
+   * Compile IF tags - much of this is from Smarty with
473
+   * some adaptions for our block level methods
474
+   * @access private
475
+   */
476 476
   function compile_tag_if($tag_args, $elseif)
477 477
   {
478 478
     // Tokenize args for 'if' tag.
@@ -627,9 +627,9 @@  discard block
 block discarded – undo
627 627
   }
628 628
 
629 629
   /**
630
-  * Compile DEFINE tags
631
-  * @access private
632
-  */
630
+   * Compile DEFINE tags
631
+   * @access private
632
+   */
633 633
   function compile_tag_define($tag_args, $op)
634 634
   {
635 635
     preg_match('#^((?:[a-z0-9\-_]+\.)+)?\$(?=[A-Z])([A-Z0-9_\-]*)(?: = (\'?)([^\']*)(\'?))?$#', $tag_args, $match);
@@ -680,9 +680,9 @@  discard block
 block discarded – undo
680 680
   }
681 681
 
682 682
   /**
683
-  * Compile INCLUDE tag
684
-  * @access private
685
-  */
683
+   * Compile INCLUDE tag
684
+   * @access private
685
+   */
686 686
   function compile_tag_include($tag_args)
687 687
   {
688 688
     // Process dynamic includes
@@ -695,19 +695,19 @@  discard block
 block discarded – undo
695 695
   }
696 696
 
697 697
   /**
698
-  * Compile INCLUDE_PHP tag
699
-  * @access private
700
-  */
698
+   * Compile INCLUDE_PHP tag
699
+   * @access private
700
+   */
701 701
   function compile_tag_include_php($tag_args)
702 702
   {
703 703
     return "\$this->_php_include('$tag_args');";
704 704
   }
705 705
 
706 706
   /**
707
-  * parse expression
708
-  * This is from Smarty
709
-  * @access private
710
-  */
707
+   * parse expression
708
+   * This is from Smarty
709
+   * @access private
710
+   */
711 711
   function _parse_is_expr($is_arg, $tokens)
712 712
   {
713 713
     $expr_end = 0;
@@ -800,14 +800,14 @@  discard block
 block discarded – undo
800 800
   }
801 801
 
802 802
   /**
803
-  * Generates a reference to the array of data values for the given
804
-  * (possibly nested) block namespace. This is a string of the form:
805
-  * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN']
806
-  *
807
-  * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above.
808
-  * NOTE: does not expect a trailing "." on the blockname.
809
-  * @access private
810
-  */
803
+   * Generates a reference to the array of data values for the given
804
+   * (possibly nested) block namespace. This is a string of the form:
805
+   * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN']
806
+   *
807
+   * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above.
808
+   * NOTE: does not expect a trailing "." on the blockname.
809
+   * @access private
810
+   */
811 811
   function generate_block_data_ref($blockname, $include_last_iterator, $defop = false)
812 812
   {
813 813
     // Get an array of the blocks involved.
@@ -843,9 +843,9 @@  discard block
 block discarded – undo
843 843
   }
844 844
 
845 845
   /**
846
-  * Write compiled file to cache directory
847
-  * @access private
848
-  */
846
+   * Write compiled file to cache directory
847
+   * @access private
848
+   */
849 849
   function compile_write($handle, $data)
850 850
   {
851 851
     $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . DOT_PHP_EX;
@@ -868,9 +868,9 @@  discard block
 block discarded – undo
868 868
 
869 869
   // Gorlum's minifier BOF
870 870
   /**
871
-  * Minifies template w/i PHP code by removing extra spaces
872
-  * @access private
873
-  */
871
+   * Minifies template w/i PHP code by removing extra spaces
872
+   * @access private
873
+   */
874 874
   function minify($html)
875 875
   {
876 876
     if(!SN::$config->tpl_minifier)
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
 
142 142
     preg_match_all('#<!-- INCLUDE (\{\$?[A-Z0-9\-_]+\}|[a-zA-Z0-9\_\-\+\./]+) -->#', $code, $matches);
143 143
     $include_blocks = $matches[1];
144
-    if($include_blocks)
144
+    if ($include_blocks)
145 145
     {
146
-      foreach($include_blocks as &$included_file)
146
+      foreach ($include_blocks as &$included_file)
147 147
       {
148 148
         $included_file .= '.tpl.html';
149 149
       }
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
       $varname = $var_val[3];
309 309
       $new = $this->generate_block_varref($namespace, $varname, $var_val[2]);
310 310
 
311
-      if(!empty($var_val[4])) {
311
+      if (!empty($var_val[4])) {
312 312
         $new = \Ptl\PtlVariableDecorator::decorate($var_val[0], $new, $this->template);
313 313
       }
314 314
 
@@ -462,8 +462,8 @@  discard block
 block discarded – undo
462 462
 
463 463
     $tag_template_php .= 'for ($_' . $tag_args . '_i = ' . $loop_start . '; $_' . $tag_args . '_i < ' . $loop_end . '; ++$_' . $tag_args . '_i){';
464 464
 //    $tag_template_php .= '$this->_block_counter["'. $tag_args . '"] = $_' . $tag_args . '_i;';
465
-    $tag_template_php .= '$_'. $tag_args . '_val = &' . $varref . '[$_'. $tag_args. '_i];';
466
-    $tag_template_php .= '$this->_block_value["'. $tag_args . '"] = &' . $varref . '[$_'. $tag_args. '_i];';
465
+    $tag_template_php .= '$_' . $tag_args . '_val = &' . $varref . '[$_' . $tag_args . '_i];';
466
+    $tag_template_php .= '$this->_block_value["' . $tag_args . '"] = &' . $varref . '[$_' . $tag_args . '_i];';
467 467
 
468 468
     return $tag_template_php;
469 469
   }
@@ -567,10 +567,10 @@  discard block
 block discarded – undo
567 567
         break;
568 568
 
569 569
         case 'is':
570
-          $is_arg_start = ($tokens[$i-1] == ')') ? array_pop($is_arg_stack) : $i-1;
570
+          $is_arg_start = ($tokens[$i - 1] == ')') ? array_pop($is_arg_stack) : $i - 1;
571 571
           $is_arg = implode(' ', array_slice($tokens, $is_arg_start, $i - $is_arg_start));
572 572
 
573
-          $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i+1));
573
+          $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i + 1));
574 574
 
575 575
           array_splice($tokens, $is_arg_start, sizeof($tokens), $new_tokens);
576 576
 
@@ -834,11 +834,11 @@  discard block
 block discarded – undo
834 834
     }
835 835
     else if ($include_last_iterator)
836 836
     {
837
-      return '$_'. $blocks[$blockcount] . '_val';
837
+      return '$_' . $blocks[$blockcount] . '_val';
838 838
     }
839 839
     else
840 840
     {
841
-      return '$_'. $blocks[$blockcount - 1] . '_val[\''. $blocks[$blockcount]. '\']';
841
+      return '$_' . $blocks[$blockcount - 1] . '_val[\'' . $blocks[$blockcount] . '\']';
842 842
     }
843 843
   }
844 844
 
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
     if ($fp = @fopen($filename, 'wb'))
856 856
     {
857 857
       @flock($fp, LOCK_EX);
858
-      @fwrite ($fp, $data);
858
+      @fwrite($fp, $data);
859 859
       @flock($fp, LOCK_UN);
860 860
       @fclose($fp);
861 861
 
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
   */
874 874
   function minify($html)
875 875
   {
876
-    if(!SN::$config->tpl_minifier)
876
+    if (!SN::$config->tpl_minifier)
877 877
     {
878 878
       return $html;
879 879
     }
@@ -885,14 +885,14 @@  discard block
 block discarded – undo
885 885
     //$html = preg_replace('/[\r\n\t]+/', ' ', $html);
886 886
     $html = preg_replace('/>[\s]*</', '><', $html); // Strip spacechars between tags
887 887
     $html = preg_replace('/[\s]+/', ' ', $html); // Replace several spacechars with one space
888
-    if(!empty($pre[0]))
888
+    if (!empty($pre[0]))
889 889
     {
890
-      foreach($pre[0] as $tag)
890
+      foreach ($pre[0] as $tag)
891 891
       {
892 892
         $tag = preg_replace('/^\ *\/\/[^\<]*?$/m', ' ', $tag); // Strips comments - except those that contains HTML comment inside
893 893
         $tag = preg_replace('/[\ \t]{2,}/', ' ', $tag); // Replace several spaces by one
894 894
         $tag = preg_replace('/\s{2,}/', "\r\n", $tag); // Replace several linefeeds by one
895
-        $html = preg_replace('/#pre#/', $tag, $html,1);
895
+        $html = preg_replace('/#pre#/', $tag, $html, 1);
896 896
       }
897 897
     }
898 898
 
Please login to merge, or discard this 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.
classes/Pages/Deprecated/PageAdminMining.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,19 +29,19 @@
 block discarded – undo
29 29
         'ID'        => self::PAGE_SORT_BY_RANK,
30 30
         'HTML_ID'   => 'byTotalRank',
31 31
         'HTML_NAME' => '{ byTotalRank }',
32
-        'SQL_SORT'  => ['u.total_rank',],
32
+        'SQL_SORT'  => ['u.total_rank', ],
33 33
       ],
34 34
       self::PAGE_SORT_BY_ID => [
35 35
         'ID'        => self::PAGE_SORT_BY_ID,
36 36
         'HTML_ID'   => 'byId',
37 37
         'HTML_NAME' => '{ byId }',
38
-        'SQL_SORT'  => ['u.id',],
38
+        'SQL_SORT'  => ['u.id', ],
39 39
       ],
40 40
       self::PAGE_SORT_BY_NAME => [
41 41
         'ID'        => self::PAGE_SORT_BY_NAME,
42 42
         'HTML_ID'   => 'byName',
43 43
         'HTML_NAME' => '{ byName }',
44
-        'SQL_SORT'  => ['u.username',],
44
+        'SQL_SORT'  => ['u.username', ],
45 45
       ],
46 46
 
47 47
       self::PAGE_SORT_BY_POINTS => [
Please login to merge, or discard this patch.
classes/Pages/Deprecated/PageAdminModules.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@
 block discarded – undo
13 13
   const SORT_BY_ACTIVITY = 1;
14 14
 
15 15
   private static $sorting = [
16
-    self::SORT_BY_PACKAGE  => ['PACKAGE', 'NAME', '!ACTIVE', '!INSTALLED',],
17
-    self::SORT_BY_ACTIVITY => ['!ACTIVE', '!INSTALLED', 'PACKAGE', 'NAME',],
16
+    self::SORT_BY_PACKAGE  => ['PACKAGE', 'NAME', '!ACTIVE', '!INSTALLED', ],
17
+    self::SORT_BY_ACTIVITY => ['!ACTIVE', '!INSTALLED', 'PACKAGE', 'NAME', ],
18 18
   ];
19 19
 
20 20
   private static $sortFields = [];
Please login to merge, or discard this patch.
classes/Fleet/FleetStatic.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
    * @return DbMysqliResultIterator|EmptyCountableIterator
19 19
    */
20 20
   public static function dbFleetsOnHoldOnPlanetsByIds($planetIds, $time = SN_TIME_NOW) {
21
-    if(empty($planetIds) || !is_array($planetIds)) {
21
+    if (empty($planetIds) || !is_array($planetIds)) {
22 22
       return new EmptyCountableIterator();
23 23
     }
24 24
 
Please login to merge, or discard this patch.
admin/admin_locale.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@  discard block
 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
 
@@ -20,12 +20,12 @@  discard block
 block discarded – undo
20 20
 function adm_lng_assign_string($lang_id, $locale_string_name, $value) {
21 21
   global $locale_string_template, $languages_info, $languages, $domain;
22 22
 
23
-  if(is_array($value)) {
24
-    foreach($value as $sub_key => $sub_value) {
23
+  if (is_array($value)) {
24
+    foreach ($value as $sub_key => $sub_value) {
25 25
       adm_lng_assign_string($lang_id, "{$locale_string_name}[{$sub_key}]", $sub_value);
26 26
     }
27
-  } elseif($value) {
28
-    if(!isset($locale_string_template[$locale_string_name])) {
27
+  } elseif ($value) {
28
+    if (!isset($locale_string_template[$locale_string_name])) {
29 29
       $locale_string_template[$locale_string_name] = array();
30 30
     }
31 31
     $locale_string_template[$locale_string_name] = array_merge($locale_string_template[$locale_string_name], array("[{$lang_id}]" => htmlentities($value, ENT_COMPAT, 'utf-8')));
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
   global $domain, $lang_id;
47 47
 
48 48
   $return = "{$ident}'{$string_name}' => ";
49
-  if(isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) {
49
+  if (isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) {
50 50
     $return .= "'" . str_replace(array("\\", "'"), array('\\\\', "\\'"), $string_value[$lang_id]) . "',";
51 51
   } else {
52 52
     $return .= "array(\r\n";
53
-    foreach($string_value as $arr_name => $arr_data) {
53
+    foreach ($string_value as $arr_name => $arr_data) {
54 54
       $return .= adm_lng_parse_string($arr_name, $arr_data, $ident . '  ');
55 55
     }
56 56
     $return .= "{$ident}),\r\n";
@@ -103,12 +103,12 @@  discard block
 block discarded – undo
103 103
 
104 104
   $string_name_new = false;
105 105
 
106
-  if(isset($honor_constants[$domain][$string_name_prefix])) {
106
+  if (isset($honor_constants[$domain][$string_name_prefix])) {
107 107
     $found_constants = array_keys($constants, $string_name);
108
-    foreach($found_constants as $constant_name) {
108
+    foreach ($found_constants as $constant_name) {
109 109
       $honor_prefix_list = is_array($honor_constants[$domain][$string_name_prefix]) ? $honor_constants[$domain][$string_name_prefix] : array($honor_constants[$domain][$string_name_prefix]);
110
-      foreach($honor_prefix_list as $honor_prefix) {
111
-        if(strpos($constant_name, $honor_prefix) === 0) {
110
+      foreach ($honor_prefix_list as $honor_prefix) {
111
+        if (strpos($constant_name, $honor_prefix) === 0) {
112 112
           $string_name_new = $constant_name;
113 113
           break;
114 114
         }
@@ -118,13 +118,13 @@  discard block
 block discarded – undo
118 118
 
119 119
   $string_name_new = $string_name_new ? $string_name_new : "'{$string_name}'";
120 120
   fwrite($file_handler, "{$ident}{$string_name_new} => ");
121
-  if(isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) {
121
+  if (isset($string_value[$lang_id]) && !is_array($string_value[$lang_id])) {
122 122
     fwrite($file_handler, "'" . str_replace(array("\\", "'"), array('\\\\', "\\'"), $string_value[$lang_id]) . "',");
123 123
 //    fwrite($file_handler, "'" . addslashes($string_value[$lang_id]) . "',");
124 124
   } else {
125 125
     $string_name_prefix = $string_name_prefix . "[{$string_name}]";
126 126
     fwrite($file_handler, "array(\r\n");
127
-    foreach($string_value as $arr_name => $arr_data) {
127
+    foreach ($string_value as $arr_name => $arr_data) {
128 128
       adm_lng_write_string($arr_name, $arr_data, $ident . '  ', $string_name_prefix);
129 129
     }
130 130
     fwrite($file_handler, "{$ident}),\r\n");
@@ -144,13 +144,13 @@  discard block
 block discarded – undo
144 144
 $languages_info = lng_get_list();
145 145
 $domain = sys_get_param_str('domain');
146 146
 
147
-if($domain) {
147
+if ($domain) {
148 148
   $lang_new = sys_get_param('lang_new');
149
-  if(!empty($lang_new) && is_array($lang_new)) {
149
+  if (!empty($lang_new) && is_array($lang_new)) {
150 150
     $constants = get_defined_constants(true);
151 151
     $constants = $constants['user'];
152 152
     ksort($constants);
153
-    foreach($languages_info as $lang_id => $land_data) {
153
+    foreach ($languages_info as $lang_id => $land_data) {
154 154
       $file_handler = fopen(SN_ROOT_PHYSICAL . "language/{$lang_id}/{$domain}.mo.php.new", 'w');
155 155
       fwrite($file_handler, "<?php\r\n\r\n/*\r\n#############################################################################
156 156
 #  Filename: {$domain}.mo.php
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 #  Website: http://www.supernova.ws
159 159
 #  Description: Massive Multiplayer Online Browser Space Strategy Game\r\n#\r\n");
160 160
 
161
-      foreach($land_data['LANG_COPYRIGHT'] as $lang_copyright) {
161
+      foreach ($land_data['LANG_COPYRIGHT'] as $lang_copyright) {
162 162
         $lang_copyright = str_replace(array('&copy;', '&quot;', '&lt;', '&gt;'), array('©', '"', '<', '>'), $lang_copyright);
163 163
         fwrite($file_handler, "#  {$lang_copyright}\r\n");
164 164
       }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 /**\r\n*\r\n* @package language\r\n* @system [{$land_data['LANG_NAME_ENGLISH']}]\r\n* @version " . SN_VERSION . "\r\n*\r\n*/\r\n
167 167
 /**\r\n* DO NOT CHANGE\r\n*/\r\n\r\nif (!defined('INSIDE')) die();\r\n
168 168
 \$a_lang_array = array(\r\n");
169
-      foreach($lang_new as $string_name => $string_value) {
169
+      foreach ($lang_new as $string_name => $string_value) {
170 170
         adm_lng_write_string($string_name, $string_value);
171 171
       }
172 172
       fwrite($file_handler, ");\r\n");
@@ -176,21 +176,21 @@  discard block
 block discarded – undo
176 176
     sys_redirect("admin_locale.php?domain={$domain}");
177 177
   }
178 178
 
179
-  foreach($languages_info as $lang_id => $lang_data) {
179
+  foreach ($languages_info as $lang_id => $lang_data) {
180 180
     $template->assign_block_vars('language', $lang_data);
181 181
     $full_filename = SN_ROOT_PHYSICAL . "language/{$lang_id}/{$domain}.mo.php";
182 182
     $languages[$lang_id] = adm_lng_load($full_filename . (file_exists($full_filename . '.new') ? '.new' : ''));
183
-    foreach($languages[$lang_id] as $locale_string_name => $cork) {
183
+    foreach ($languages[$lang_id] as $locale_string_name => $cork) {
184 184
       adm_lng_assign_string($lang_id, "[{$locale_string_name}]", $languages[$lang_id][$locale_string_name]);
185 185
     }
186 186
   }
187 187
 
188
-  foreach($locale_string_template as $locale_string_name => $locale_string_list) {
188
+  foreach ($locale_string_template as $locale_string_name => $locale_string_list) {
189 189
     $template->assign_block_vars('string', array(
190 190
       'NAME' => $locale_string_name,
191 191
     ));
192 192
 
193
-    foreach($languages_info as $lang_id => $cork2) {
193
+    foreach ($languages_info as $lang_id => $cork2) {
194 194
       $template->assign_block_vars('string.locale', array(
195 195
         'LANG' => $lang_id,
196 196
         'VALUE' => $locale_string_list["[{$lang_id}]"],
@@ -206,17 +206,17 @@  discard block
 block discarded – undo
206 206
   $dir = dir($path);
207 207
   while (false !== ($lang_id = $dir->read())) {
208 208
     $full_path = $path . $lang_id;
209
-    if($lang_id[0] != "." && is_dir($full_path)) {
209
+    if ($lang_id[0] != "." && is_dir($full_path)) {
210 210
       $lang_file_list = dir($full_path);
211 211
       while (false !== ($filename = $lang_file_list->read())) {
212 212
         $lang_domain = strtolower(substr($filename, 0, strpos($filename, '.')));
213
-        if(!$lang_domain) {
213
+        if (!$lang_domain) {
214 214
           continue;
215 215
         }
216 216
 
217 217
         $file_ext = strtolower(substr($filename, strpos($filename, '.')));
218
-        if($lang_domain != 'language') {
219
-          if($file_ext == '.mo.php.new' || ($file_ext == '.mo.php' && empty($languages[$lang_id][$lang_domain]))) {
218
+        if ($lang_domain != 'language') {
219
+          if ($file_ext == '.mo.php.new' || ($file_ext == '.mo.php' && empty($languages[$lang_id][$lang_domain]))) {
220 220
             $language_domains[$lang_domain] = $lang_domain;
221 221
             $languages[$lang_id][$lang_domain] = $lang_domain;
222 222
           }
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
   }
227 227
   $dir->close();
228 228
 
229
-  foreach($language_domains as $lang_domain) {
229
+  foreach ($language_domains as $lang_domain) {
230 230
     $template->assign_block_vars('domain', array(
231 231
       'NAME' => $lang_domain,
232 232
     ));
Please login to merge, or discard this patch.
includes/constants/constants_payments.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
 define('SN_PAYMENT_REQUEST_OK', 0);
16 16
 define('SN_PAYMENT_REQUEST_ERROR_UNIT_AMOUNT', 1);
17 17
 define('SN_PAYMENT_REQUEST_ERROR_PAYLINK_UNSUPPORTED', 2);
18
-define('SN_PAYMENT_REQUEST_IP_WRONG', 3);  // Неправильный IP входящей системы - обычно хак
18
+define('SN_PAYMENT_REQUEST_IP_WRONG', 3); // Неправильный IP входящей системы - обычно хак
19 19
 define('SN_PAYMENT_REQUEST_COMMAND_UNSUPPORTED', 4); // Неподдерживаемая команда - обычно хак
20 20
 define('SN_PAYMENT_REQUEST_SIGNATURE_INVALID', 5); // Неправильная подпись или не сошлась контрольная сумма - обычно хак
21 21
 define('SN_MODULE_DISABLED', 6); // Модуль отключен // УНИВЕРСАЛЬНЫЙ ОТВЕТ!
Please login to merge, or discard this patch.