next(); * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. * * @return mixed */ public static function xmlDeserialize(Reader $reader) { $result = [ 'contentType' => $reader->getAttribute('content-type') ?: 'text/vcard', 'version' => $reader->getAttribute('version') ?: '3.0', ]; $elems = (array) $reader->parseInnerTree(); $elems = array_filter($elems, function ($element) { return '{urn:ietf:params:xml:ns:carddav}prop' === $element['name'] && isset($element['attributes']['name']); }); $result['addressDataProperties'] = array_map(function ($element) { return $element['attributes']['name']; }, $elems); return $result; } }