PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 1.2.20
Booking for Appointments and Events Calendar – Amelia v1.2.20
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 / xml / lib / Element / Elements.php
ameliabooking / vendor / sabre / xml / lib / Element Last commit date
Base.php 1 year ago Cdata.php 1 year ago Elements.php 1 year ago KeyValue.php 1 year ago Uri.php 1 year ago XmlFragment.php 1 year ago
Elements.php
103 lines
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Sabre\Xml\Element;
6
7 use Sabre\Xml;
8 use Sabre\Xml\Deserializer;
9 use Sabre\Xml\Serializer;
10
11 /**
12 * 'Elements' is a simple list of elements, without values or attributes.
13 * For example, Elements will parse:.
14 *
15 * <?xml version="1.0"?>
16 * <s:root xmlns:s="http://sabredav.org/ns">
17 * <s:elem1 />
18 * <s:elem2 />
19 * <s:elem3 />
20 * <s:elem4>content</s:elem4>
21 * <s:elem5 attr="val" />
22 * </s:root>
23 *
24 * Into:
25 *
26 * [
27 * "{http://sabredav.org/ns}elem1",
28 * "{http://sabredav.org/ns}elem2",
29 * "{http://sabredav.org/ns}elem3",
30 * "{http://sabredav.org/ns}elem4",
31 * "{http://sabredav.org/ns}elem5",
32 * ];
33 *
34 * @copyright Copyright (C) 2009-2015 fruux GmbH (https://fruux.com/).
35 * @author Evert Pot (http://evertpot.com/)
36 * @license http://sabre.io/license/ Modified BSD License
37 */
38 class Elements implements Xml\Element
39 {
40 /**
41 * Value to serialize.
42 *
43 * @var array<int, mixed>
44 */
45 protected array $value;
46
47 /**
48 * Constructor.
49 *
50 * @param array<int, mixed> $value
51 */
52 public function __construct(array $value = [])
53 {
54 $this->value = $value;
55 }
56
57 /**
58 * The xmlSerialize method is called during xml writing.
59 *
60 * Use the $writer argument to write its own xml serialization.
61 *
62 * An important note: do _not_ create a parent element. Any element
63 * implementing XmlSerializable should only ever write what's considered
64 * its 'inner xml'.
65 *
66 * The parent of the current element is responsible for writing a
67 * containing element.
68 *
69 * This allows serializers to be re-used for different element names.
70 *
71 * If you are opening new elements, you must also close them again.
72 */
73 public function xmlSerialize(Xml\Writer $writer): void
74 {
75 Serializer\enum($writer, $this->value);
76 }
77
78 /**
79 * The deserialize method is called during xml parsing.
80 *
81 * This method is called statically, this is because in theory this method
82 * may be used as a type of constructor, or factory method.
83 *
84 * Often you want to return an instance of the current class, but you are
85 * free to return other data as well.
86 *
87 * Important note 2: You are responsible for advancing the reader to the
88 * next element. Not doing anything will result in a never-ending loop.
89 *
90 * If you just want to skip parsing for this element altogether, you can
91 * just call $reader->next();
92 *
93 * $reader->parseSubTree() will parse the entire sub-tree, and advance to
94 * the next element.
95 *
96 * @return string[]
97 */
98 public static function xmlDeserialize(Xml\Reader $reader)
99 {
100 return Deserializer\enum($reader);
101 }
102 }
103