Remove some superfluous "else"s in generated PHP code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11610 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ea578fcc8f
commit
c4f5f22f67
1 changed files with 8 additions and 8 deletions
|
|
@ -2022,7 +2022,7 @@ done:
|
|||
Printf(s_phpclasses, "\t\tif (function_exists($func)) return call_user_func($func,$this->%s,$value);\n", SWIG_PTR);
|
||||
}
|
||||
Printf(s_phpclasses, "\t\tif ($var === 'thisown') return swig_%s_alter_newobject($this->%s,$value);\n", module, SWIG_PTR);
|
||||
Printf(s_phpclasses, "\t\telse $this->%s[$var] = $value;\n", SWIG_DATA);
|
||||
Printf(s_phpclasses, "\t\t$this->%s[$var] = $value;\n", SWIG_DATA);
|
||||
if (baseclass) {
|
||||
Printf(s_phpclasses, "\t\treturn %s%s::__set($var,$value);\n", prefix, baseclass);
|
||||
}
|
||||
|
|
@ -2032,16 +2032,16 @@ done:
|
|||
Printf(s_phpclasses, "\n\tfunction __isset($var) {\n");
|
||||
Printf(s_phpclasses, "\t\tif (function_exists('%s_'.$var.'_set')) return true;\n", shadow_classname);
|
||||
Printf(s_phpclasses, "\t\tif ($var === 'thisown') return true;\n");
|
||||
Printf(s_phpclasses, "\t\telse return array_key_exists($var, $this->%s);\n", SWIG_DATA);
|
||||
Printf(s_phpclasses, "\t\treturn array_key_exists($var, $this->%s);\n", SWIG_DATA);
|
||||
Printf(s_phpclasses, "\t}\n");
|
||||
} else {
|
||||
Printf(s_phpclasses, "\n\tfunction __set($var,$value) {\n");
|
||||
Printf(s_phpclasses, "\t\tif ($var === 'thisown') return swig_%s_alter_newobject($this->%s,$value);\n", module, SWIG_PTR);
|
||||
Printf(s_phpclasses, "\t\telse $this->%s[$var] = $value;\n", SWIG_DATA);
|
||||
Printf(s_phpclasses, "\t\t$this->%s[$var] = $value;\n", SWIG_DATA);
|
||||
Printf(s_phpclasses, "\t}\n");
|
||||
Printf(s_phpclasses, "\n\tfunction __isset($var) {\n");
|
||||
Printf(s_phpclasses, "\t\tif ($var === 'thisown') return true;\n");
|
||||
Printf(s_phpclasses, "\t\telse return array_key_exists($var, $this->%s);\n", SWIG_DATA);
|
||||
Printf(s_phpclasses, "\t\treturn array_key_exists($var, $this->%s);\n", SWIG_DATA);
|
||||
Printf(s_phpclasses, "\t}\n");
|
||||
}
|
||||
// Write property GET handlers
|
||||
|
|
@ -2062,19 +2062,19 @@ done:
|
|||
Printf(s_phpclasses, "\t\t$func = '%s_'.$var.'_get';\n", shadow_classname);
|
||||
Printf(s_phpclasses, "\t\tif (function_exists($func)) return call_user_func($func,$this->%s);\n", SWIG_PTR);
|
||||
}
|
||||
Printf(s_phpclasses, "\t\telse if ($var === 'thisown') return swig_%s_get_newobject($this->%s);\n", module, SWIG_PTR);
|
||||
Printf(s_phpclasses, "\t\telse if(array_key_exists($var, $this->%s)) return $this->%s[$var];\n", SWIG_DATA, SWIG_DATA);
|
||||
// Reading an unknown property name gives null in PHP.
|
||||
Printf(s_phpclasses, "\t\tif ($var === 'thisown') return swig_%s_get_newobject($this->%s);\n", module, SWIG_PTR);
|
||||
Printf(s_phpclasses, "\t\tif (array_key_exists($var, $this->%s)) return $this->%s[$var];\n", SWIG_DATA, SWIG_DATA);
|
||||
if (base.item) {
|
||||
Printf(s_phpclasses, "\t\treturn %s%s::__get($var);\n", prefix, baseclass);
|
||||
} else {
|
||||
// Reading an unknown property name gives null in PHP.
|
||||
Printf(s_phpclasses, "\t\treturn null;\n");
|
||||
}
|
||||
Printf(s_phpclasses, "\t}\n");
|
||||
} else {
|
||||
Printf(s_phpclasses, "\n\tfunction __get($var) {\n");
|
||||
Printf(s_phpclasses, "\t\tif ($var === 'thisown') return swig_%s_get_newobject($this->%s);\n", module, SWIG_PTR);
|
||||
Printf(s_phpclasses, "\t\telse return $this->%s[$var];\n", SWIG_DATA);
|
||||
Printf(s_phpclasses, "\t\treturn $this->%s[$var];\n", SWIG_DATA);
|
||||
Printf(s_phpclasses, "\t}\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue