PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.6
Booking for Appointments and Events Calendar – Amelia v2.4.6
2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / sabre / vobject / lib / Parser / XML / Element / KeyValue.php
ameliabooking / vendor / sabre / vobject / lib / Parser / XML / Element Last commit date
KeyValue.php 7 months ago
KeyValue.php
64 lines
1 <?php
2
3 namespace AmeliaVendor\Sabre\VObject\Parser\XML\Element;
4
5 use AmeliaVendor\Sabre\Xml as SabreXml;
6
7 /**
8 * Our own sabre/xml key-value element.
9 *
10 * It just removes the clark notation.
11 *
12 * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
13 * @author Ivan Enderlin
14 * @license http://sabre.io/license/ Modified BSD License
15 */
16 class KeyValue extends SabreXml\Element\KeyValue
17 {
18 /**
19 * The deserialize method is called during xml parsing.
20 *
21 * This method is called statically, this is because in theory this method
22 * may be used as a type of constructor, or factory method.
23 *
24 * Often you want to return an instance of the current class, but you are
25 * free to return other data as well.
26 *
27 * Important note 2: You are responsible for advancing the reader to the
28 * next element. Not doing anything will result in a never-ending loop.
29 *
30 * If you just want to skip parsing for this element altogether, you can
31 * just call $reader->next();
32 *
33 * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
34 * the next element.
35 *
36 * @param XML\Reader $reader
37 */
38 public static function xmlDeserialize(SabreXml\Reader $reader): array
39 {
40 // If there's no children, we don't do anything.
41 if ($reader->isEmptyElement) {
42 $reader->next();
43
44 return [];
45 }
46
47 $values = [];
48 $reader->read();
49
50 do {
51 if (SabreXml\Reader::ELEMENT === $reader->nodeType) {
52 $name = $reader->localName;
53 $values[$name] = $reader->parseCurrentElement()['value'];
54 } else {
55 $reader->read();
56 }
57 } while (SabreXml\Reader::END_ELEMENT !== $reader->nodeType);
58
59 $reader->read();
60
61 return $values;
62 }
63 }
64