Skip to content

Commit ce1307f

Browse files
committed
Update the xml parser to be compatible with php7.2
1 parent 09f5669 commit ce1307f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Parsers/XmlParser.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
class XmlParser extends Parser
44
{
5-
65
private $xml;
76

87
/**
@@ -23,7 +22,7 @@ private function objectify($value)
2322
foreach ((array) $temp as $key => $value) {
2423
if ($key === "@attributes") {
2524
$result['_' . key($value)] = $value[key($value)];
26-
} elseif (count($value) < 1) {
25+
} elseif (is_array($value) && count($value) < 1) {
2726
$result[$key] = '';
2827
} else {
2928
$result[$key] = (is_array($value) or is_object($value)) ? $this->objectify($value) : $value;

0 commit comments

Comments
 (0)