php7 fixes master
authorAlan Knowles <alan@roojs.com>
Tue, 15 Dec 2020 07:06:03 +0000 (15:06 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 15 Dec 2020 07:06:03 +0000 (15:06 +0800)
Code.php
FormToSQL.php
Generator/JSON.php
Palette.php

index 636e34c..6564e7e 100644 (file)
--- a/Code.php
+++ b/Code.php
@@ -412,19 +412,19 @@ class Pman_Builder_Code extends Pman
                 case is_object($v):
                   
                     $out .= $ix . "$k : " . $this->toJSObj($v, $in+1);
-                    continue;
+                    continue 2;
                 
                 case is_array($v):
                     $out .= $ix . "$k : " . $this->toJSAr($v, $in+1);
-                    continue;
+                    continue 2;
             
                 case is_string($v) && ($k[0] == '|'):
                     $out .= $ix . substr($k,1). ": " . implode("\n" . $ix, explode("\n", $v));
-                    continue;
+                    continue 2;
            
                 default :
                     $out .= $ix . "$k : " . $this->toJSPrim($v, isset($obj->xtype) ? $obj->xtype : '', $k);
-                    continue;
+                    continue 2;
             }
              
             // property is string/bool/num... 
@@ -475,11 +475,11 @@ class Pman_Builder_Code extends Pman
             switch(true) {
                 case is_object($v):
                     $out .= $ix . $this->toJSObj($v, $in+1);
-                    continue;
+                    continue 2;
                 
                 case is_array($v):
                     $out .= $ix .  $this->toJSAr($v, $in+1);
-                    continue;
+                    continue 2;
             
                // case is_string($v) && ($k[0] == '|'): // can not have raw in an array?
                //     $out .= $ix . . $v;
@@ -487,7 +487,7 @@ class Pman_Builder_Code extends Pman
            
                 default :
                     $out .=  $this->toJSPrim($v); // we can not fix these...!!!!
-                    continue;
+                    continue 2;  
             }
              
         }
index a0d451a..835ee30 100644 (file)
@@ -139,7 +139,7 @@ class Pman_Builder_FormToSQL extends Pman {
                     $f->type = $type;
                     $f->size = $len;
                     $this->cols[] = $f;
-                    continue;
+                    break;
                 }
                 // otherwise it's a datasource based one...
                 // our 18N fields are a bit odd here...
@@ -149,7 +149,7 @@ class Pman_Builder_FormToSQL extends Pman {
                     $f->size = 8;
                     $f->default = "''";
                     $this->cols[] = $f;
-                    continue;
+                    break;
                 }
                 $f->name = isset($o->hiddenName) ? $o->hiddenName : $o->name; 
                 $f->type = 'INT';
@@ -157,14 +157,14 @@ class Pman_Builder_FormToSQL extends Pman {
                 $f->extra = "NOT NULL";
                 $f->default = 0;
                 $this->cols[] = $f;
-                continue;
+                break;
             
             case 'TextArea':
                 $f->name = $o->name;
                 $f->type = 'TEXT';
                 
                 $this->cols[] = $f;
-                continue;
+                break;
             
             case 'DateField':
             case 'NumberField':
@@ -186,7 +186,7 @@ class Pman_Builder_FormToSQL extends Pman {
                 array_unshift($this->cols, $f); 
                 break;
             default:
-                continue;
+                break;
             
         }
          
index 2dfe067..7763c2d 100644 (file)
@@ -51,7 +51,7 @@ class Pman_Builder_Generator_JSON extends Services_JSON
                 */
                 for ($c = 0; $c < $strlen_var; ++$c) {
 
-                    $ord_var_c = ord($var{$c});
+                    $ord_var_c = ord($var[$c]);
 
                     switch (true) {
                         case $ord_var_c == 0x08:
@@ -74,12 +74,12 @@ class Pman_Builder_Generator_JSON extends Services_JSON
                         case $ord_var_c == 0x2F:
                         case $ord_var_c == 0x5C:
                             // double quote, slash, slosh
-                            $ascii .= '\\'.$var{$c};
+                            $ascii .= '\\'.$var[$c];
                             break;
 
                         case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
                             // characters U-00000000 - U-0000007F (same as ASCII)
-                            $ascii .= $var{$c};
+                            $ascii .= $var[$c];
                             break;
 
                         case (($ord_var_c & 0xE0) == 0xC0):
@@ -91,7 +91,7 @@ class Pman_Builder_Generator_JSON extends Services_JSON
                                 break;
                             }
                             
-                            $char = pack('C*', $ord_var_c, ord($var{$c + 1}));
+                            $char = pack('C*', $ord_var_c, ord($var[$c + 1]));
                             $c += 1;
                             $utf16 = $this->utf82utf16($char);
                             $ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -106,8 +106,8 @@ class Pman_Builder_Generator_JSON extends Services_JSON
                             // characters U-00000800 - U-0000FFFF, mask 1110XXXX
                             // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
                             $char = pack('C*', $ord_var_c,
-                                         @ord($var{$c + 1}),
-                                         @ord($var{$c + 2}));
+                                         @ord($var[$c + 1]),
+                                         @ord($var[$c + 2]));
                             $c += 2;
                             $utf16 = $this->utf82utf16($char);
                             $ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -122,9 +122,9 @@ class Pman_Builder_Generator_JSON extends Services_JSON
                             // characters U-00010000 - U-001FFFFF, mask 11110XXX
                             // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
                             $char = pack('C*', $ord_var_c,
-                                         ord($var{$c + 1}),
-                                         ord($var{$c + 2}),
-                                         ord($var{$c + 3}));
+                                         ord($var[$c + 1]),
+                                         ord($var[$c + 2]),
+                                         ord($var[$c + 3]));
                             $c += 3;
                             $utf16 = $this->utf82utf16($char);
                             $ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -139,10 +139,10 @@ class Pman_Builder_Generator_JSON extends Services_JSON
                                 break;
                             }
                             $char = pack('C*', $ord_var_c,
-                                         ord($var{$c + 1}),
-                                         ord($var{$c + 2}),
-                                         ord($var{$c + 3}),
-                                         ord($var{$c + 4}));
+                                         ord($var[$c + 1]),
+                                         ord($var[$c + 2]),
+                                         ord($var[$c + 3]),
+                                         ord($var[$c + 4]));
                             $c += 4;
                             $utf16 = $this->utf82utf16($char);
                             $ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -157,11 +157,11 @@ class Pman_Builder_Generator_JSON extends Services_JSON
                             // characters U-04000000 - U-7FFFFFFF, mask 1111110X
                             // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
                             $char = pack('C*', $ord_var_c,
-                                         ord($var{$c + 1}),
-                                         ord($var{$c + 2}),
-                                         ord($var{$c + 3}),
-                                         ord($var{$c + 4}),
-                                         ord($var{$c + 5}));
+                                         ord($var[$c + 1]),
+                                         ord($var[$c + 2]),
+                                         ord($var[$c + 3]),
+                                         ord($var[$c + 4]),
+                                         ord($var[$c + 5]));
                             $c += 5;
                             $utf16 = $this->utf82utf16($char);
                             $ascii .= sprintf('\u%04s', bin2hex($utf16));
index 54f21bd..23912fc 100644 (file)
@@ -99,7 +99,7 @@ class Pman_Builder_Palette extends Pman
                 case 0:
                     $left[] = $l;
                     
-                    continue;
+                    continue 2;
                 case 1:
                     if (!isset($res[$l])) {
                         $res[$l] = array(); 
@@ -107,12 +107,11 @@ class Pman_Builder_Palette extends Pman
                     foreach($left as $ll) {
                         $res[$l][$ll] = true; 
                     }
-                    continue;
+                    continue 2;
                 default:
-                    continue;
+                    continue 2;
             }
-            
-            
+             
         }
         $ret = array();
         ksort($res);