diff options
Diffstat (limited to 'vendor/sabre/xml/lib/Reader.php')
-rw-r--r-- | vendor/sabre/xml/lib/Reader.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/vendor/sabre/xml/lib/Reader.php b/vendor/sabre/xml/lib/Reader.php index 37e0c86dd..a28cf8c3b 100644 --- a/vendor/sabre/xml/lib/Reader.php +++ b/vendor/sabre/xml/lib/Reader.php @@ -118,7 +118,7 @@ class Reader extends XMLReader * If the $elementMap argument is specified, the existing elementMap will * be overridden while parsing the tree, and restored after this process. * - * @return array|string + * @return array|string|null */ public function parseInnerTree(array $elementMap = null) { @@ -147,7 +147,9 @@ class Reader extends XMLReader throw new ParseException('This should never happen (famous last words)'); } - while (true) { + $keepOnParsing = true; + + while ($keepOnParsing) { if (!$this->isValid()) { $errors = libxml_get_errors(); @@ -169,7 +171,8 @@ class Reader extends XMLReader case self::END_ELEMENT: // Ensuring we are moving the cursor after the end element. $this->read(); - break 2; + $keepOnParsing = false; + break; case self::NONE: throw new ParseException('We hit the end of the document prematurely. This likely means that some parser "eats" too many elements. Do not attempt to continue parsing.'); default: @@ -223,7 +226,7 @@ class Reader extends XMLReader } $value = call_user_func( - $this->getDeserializerForElementName($name), + $this->getDeserializerForElementName((string) $name), $this ); |