diff options
| author | Christian Schneider | 2026-10-12 14:21:13 +0200 |
|---|---|---|
| committer | Christian Schneider | 2026-10-12 14:21:13 +0200 |
| commit | 5a89aabaa87b970ab9f9360bc4efaac3aa774b77 (patch) | |
| tree | 1f5d4d0d3fdd973d59ec9776ef6a43c2bfbacfb4 /it_xml.class | |
| parent | 36f6da53f190581a53073993218f290b3932782a (diff) | |
| download | itools-5a89aabaa87b970ab9f9360bc4efaac3aa774b77.tar.gz itools-5a89aabaa87b970ab9f9360bc4efaac3aa774b77.tar.bz2 itools-5a89aabaa87b970ab9f9360bc4efaac3aa774b77.zip | |
Fix PHP 8.6 warning when using is_a() with strings but without allow_string = true
Diffstat (limited to 'it_xml.class')
| -rw-r--r-- | it_xml.class | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/it_xml.class b/it_xml.class index d58f020..e8e9cc3 100644 --- a/it_xml.class +++ b/it_xml.class @@ -191,7 +191,7 @@ function start_element($dummy_parser, $name, $attrs) else array_unshift($this->_stack, new $name); - if (!is_a($this->_stack[0], "it_xml")) + if (!$this->_stack[0] instanceof it_xml) $this->error .= "Class $name used in it_xml for tag $name does not extend it_xml: Name clash?\n"; if ($attrs) @@ -214,7 +214,7 @@ function end_element($dummy_parser, $name) array_push($this->_stack[1]->$name, $this->_stack[0]); else if (isset($this->_stack[1]->$name)) { - if (is_a($this->_stack[1]->$name, "it_xml")) + if ($this->_stack[1]->$name instanceof it_xml) $this->_stack[1]->$name = array($this->_stack[1]->$name, &$this->_stack[0]); else $this->error .= "Variable $name used in it_xml for tag {$name} is already used in object: Name clash?\n"; @@ -284,7 +284,7 @@ function to_xml($p = array()) { foreach ($values as $value) { - if (is_a($value, "it_xml")) + if ($value instanceof it_xml) { $body .= $value->to_xml($p); $indentation = $currentindentation; @@ -293,7 +293,7 @@ function to_xml($p = array()) } else if (is_object($values)) { - if (is_a($values, "it_xml")) + if ($values instanceof it_xml) { $body .= $values->to_xml($p); $indentation = $currentindentation; @@ -317,7 +317,7 @@ function elements() foreach (get_object_vars($this) as $key => $value) { - if (is_a($value, "it_xml") || (is_array($value) && is_a($value[0], "it_xml"))) + if ($value instanceof it_xml || (is_array($value) && $value[0] instanceof it_xml)) $result[$key] =& $this->$key; } @@ -326,7 +326,7 @@ function elements() function error() { - return is_a($this, "it_xml") ? $this->error : $GLOBALS['IT_XML_ERROR']; + return $this instanceof it_xml ? $this->error : $GLOBALS['IT_XML_ERROR']; } /** @@ -351,7 +351,7 @@ function set($vals, $parentprefix = null) $arr = (array)$this->$key; foreach ($val as $i => $v) { - if (!is_a($arr[$i], "it_xml")) + if (!$arr[$i] instanceof it_xml) $arr[$i] = new $classname; $arr[$i]->set($v, $prefix); } @@ -359,7 +359,7 @@ function set($vals, $parentprefix = null) } else { - if (!is_a($this->$key, "it_xml")) + if (!$this->$key instanceof it_xml) $this->$key = new $classname; $this->$key->set($val, $prefix); } |