diff options
Diffstat (limited to 'vendor/sabre/xml/lib/Deserializer/functions.php')
-rw-r--r-- | vendor/sabre/xml/lib/Deserializer/functions.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/vendor/sabre/xml/lib/Deserializer/functions.php b/vendor/sabre/xml/lib/Deserializer/functions.php index c4f240970..50818098b 100644 --- a/vendor/sabre/xml/lib/Deserializer/functions.php +++ b/vendor/sabre/xml/lib/Deserializer/functions.php @@ -55,7 +55,7 @@ use Sabre\Xml\Reader; * Attributes will be removed from the top-level elements. If elements with * the same name appear twice in the list, only the last one will be kept. */ -function keyValue(Reader $reader, string $namespace = null): array +function keyValue(Reader $reader, ?string $namespace = null): array { // If there's no children, we don't do anything. if ($reader->isEmptyElement) { @@ -144,7 +144,7 @@ function keyValue(Reader $reader, string $namespace = null): array * * @return string[] */ -function enum(Reader $reader, string $namespace = null): array +function enum(Reader $reader, ?string $namespace = null): array { // If there's no children, we don't do anything. if ($reader->isEmptyElement) { @@ -215,8 +215,11 @@ function valueObject(Reader $reader, string $className, string $namespace) // Ignore property $reader->next(); } + } elseif (Reader::ELEMENT === $reader->nodeType) { + // Skipping element from different namespace + $reader->next(); } else { - if (!$reader->read()) { + if (Reader::END_ELEMENT !== $reader->nodeType && !$reader->read()) { break; } } @@ -322,8 +325,6 @@ function mixedContent(Reader $reader): array * * You can use, e.g., a named constructor (factory method) to create an object using * this function. - * - * @return mixed */ function functionCaller(Reader $reader, callable $func, string $namespace) { |