Completed
Branch develop (2b264a)
by
unknown
24:37
created
htdocs/includes/sabre/sabre/dav/lib/DAV/Xml/Service.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -13,35 +13,35 @@
 block discarded – undo
13 13
  */
14 14
 class Service extends \Sabre\Xml\Service
15 15
 {
16
-    /**
17
-     * This is a list of XML elements that we automatically map to PHP classes.
18
-     *
19
-     * For instance, this list may contain an entry `{DAV:}propfind` that would
20
-     * be mapped to Sabre\DAV\Xml\Request\PropFind
21
-     */
22
-    public $elementMap = [
23
-        '{DAV:}multistatus' => 'Sabre\\DAV\\Xml\\Response\\MultiStatus',
24
-        '{DAV:}response' => 'Sabre\\DAV\\Xml\\Element\\Response',
16
+	/**
17
+	 * This is a list of XML elements that we automatically map to PHP classes.
18
+	 *
19
+	 * For instance, this list may contain an entry `{DAV:}propfind` that would
20
+	 * be mapped to Sabre\DAV\Xml\Request\PropFind
21
+	 */
22
+	public $elementMap = [
23
+		'{DAV:}multistatus' => 'Sabre\\DAV\\Xml\\Response\\MultiStatus',
24
+		'{DAV:}response' => 'Sabre\\DAV\\Xml\\Element\\Response',
25 25
 
26
-        // Requests
27
-        '{DAV:}propfind' => 'Sabre\\DAV\\Xml\\Request\\PropFind',
28
-        '{DAV:}propertyupdate' => 'Sabre\\DAV\\Xml\\Request\\PropPatch',
29
-        '{DAV:}mkcol' => 'Sabre\\DAV\\Xml\\Request\\MkCol',
26
+		// Requests
27
+		'{DAV:}propfind' => 'Sabre\\DAV\\Xml\\Request\\PropFind',
28
+		'{DAV:}propertyupdate' => 'Sabre\\DAV\\Xml\\Request\\PropPatch',
29
+		'{DAV:}mkcol' => 'Sabre\\DAV\\Xml\\Request\\MkCol',
30 30
 
31
-        // Properties
32
-        '{DAV:}resourcetype' => 'Sabre\\DAV\\Xml\\Property\\ResourceType',
33
-    ];
31
+		// Properties
32
+		'{DAV:}resourcetype' => 'Sabre\\DAV\\Xml\\Property\\ResourceType',
33
+	];
34 34
 
35
-    /**
36
-     * This is a default list of namespaces.
37
-     *
38
-     * If you are defining your own custom namespace, add it here to reduce
39
-     * bandwidth and improve legibility of xml bodies.
40
-     *
41
-     * @var array
42
-     */
43
-    public $namespaceMap = [
44
-        'DAV:' => 'd',
45
-        'http://sabredav.org/ns' => 's',
46
-    ];
35
+	/**
36
+	 * This is a default list of namespaces.
37
+	 *
38
+	 * If you are defining your own custom namespace, add it here to reduce
39
+	 * bandwidth and improve legibility of xml bodies.
40
+	 *
41
+	 * @var array
42
+	 */
43
+	public $namespaceMap = [
44
+		'DAV:' => 'd',
45
+		'http://sabredav.org/ns' => 's',
46
+	];
47 47
 }
Please login to merge, or discard this patch.
htdocs/includes/sabre/sabre/dav/lib/DAV/Xml/Element/Sharee.php 1 patch
Indentation   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -22,168 +22,168 @@
 block discarded – undo
22 22
  */
23 23
 class Sharee implements Element
24 24
 {
25
-    /**
26
-     * A URL. Usually a mailto: address, could also be a principal url.
27
-     * This uniquely identifies the sharee.
28
-     *
29
-     * @var string
30
-     */
31
-    public $href;
32
-
33
-    /**
34
-     * A local principal path. The server will do its best to locate the
35
-     * principal uri based on the given uri. If we could find a local matching
36
-     * principal uri, this property will contain the value.
37
-     *
38
-     * @var string|null
39
-     */
40
-    public $principal;
41
-
42
-    /**
43
-     * A list of WebDAV properties that describe the sharee. This might for
44
-     * example contain a {DAV:}displayname with the real name of the user.
45
-     *
46
-     * @var array
47
-     */
48
-    public $properties = [];
49
-
50
-    /**
51
-     * Share access level. One of the Sabre\DAV\Sharing\Plugin::ACCESS
52
-     * constants.
53
-     *
54
-     * Can be one of:
55
-     *
56
-     * ACCESS_READ
57
-     * ACCESS_READWRITE
58
-     * ACCESS_SHAREDOWNER
59
-     * ACCESS_NOACCESS
60
-     *
61
-     * depending on context.
62
-     *
63
-     * @var int
64
-     */
65
-    public $access;
66
-
67
-    /**
68
-     * When a sharee is originally invited to a share, the sharer may add
69
-     * a comment. This will be placed in this property.
70
-     *
71
-     * @var string
72
-     */
73
-    public $comment;
74
-
75
-    /**
76
-     * The status of the invite, should be one of the
77
-     * Sabre\DAV\Sharing\Plugin::INVITE constants.
78
-     *
79
-     * @var int
80
-     */
81
-    public $inviteStatus;
82
-
83
-    /**
84
-     * Creates the object.
85
-     *
86
-     * $properties will be used to populate all internal properties.
87
-     */
88
-    public function __construct(array $properties = [])
89
-    {
90
-        foreach ($properties as $k => $v) {
91
-            if (property_exists($this, $k)) {
92
-                $this->$k = $v;
93
-            } else {
94
-                throw new \InvalidArgumentException('Unknown property: '.$k);
95
-            }
96
-        }
97
-    }
98
-
99
-    /**
100
-     * The xmlSerialize method is called during xml writing.
101
-     *
102
-     * Use the $writer argument to write its own xml serialization.
103
-     *
104
-     * An important note: do _not_ create a parent element. Any element
105
-     * implementing XmlSerializable should only ever write what's considered
106
-     * its 'inner xml'.
107
-     *
108
-     * The parent of the current element is responsible for writing a
109
-     * containing element.
110
-     *
111
-     * This allows serializers to be re-used for different element names.
112
-     *
113
-     * If you are opening new elements, you must also close them again.
114
-     */
115
-    public function xmlSerialize(Writer $writer)
116
-    {
117
-        $writer->write([
118
-            new Href($this->href),
119
-            '{DAV:}prop' => $this->properties,
120
-            '{DAV:}share-access' => new ShareAccess($this->access),
121
-        ]);
122
-        switch ($this->inviteStatus) {
123
-            case Plugin::INVITE_NORESPONSE:
124
-                $writer->writeElement('{DAV:}invite-noresponse');
125
-                break;
126
-            case Plugin::INVITE_ACCEPTED:
127
-                $writer->writeElement('{DAV:}invite-accepted');
128
-                break;
129
-            case Plugin::INVITE_DECLINED:
130
-                $writer->writeElement('{DAV:}invite-declined');
131
-                break;
132
-            case Plugin::INVITE_INVALID:
133
-                $writer->writeElement('{DAV:}invite-invalid');
134
-                break;
135
-        }
136
-    }
137
-
138
-    /**
139
-     * The deserialize method is called during xml parsing.
140
-     *
141
-     * This method is called statically, this is because in theory this method
142
-     * may be used as a type of constructor, or factory method.
143
-     *
144
-     * Often you want to return an instance of the current class, but you are
145
-     * free to return other data as well.
146
-     *
147
-     * You are responsible for advancing the reader to the next element. Not
148
-     * doing anything will result in a never-ending loop.
149
-     *
150
-     * If you just want to skip parsing for this element altogether, you can
151
-     * just call $reader->next();
152
-     *
153
-     * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
154
-     * the next element.
155
-     *
156
-     * @return mixed
157
-     */
158
-    public static function xmlDeserialize(Reader $reader)
159
-    {
160
-        // Temporarily override configuration
161
-        $reader->pushContext();
162
-        $reader->elementMap['{DAV:}share-access'] = 'Sabre\DAV\Xml\Property\ShareAccess';
163
-        $reader->elementMap['{DAV:}prop'] = 'Sabre\Xml\Deserializer\keyValue';
164
-
165
-        $elems = Deserializer\keyValue($reader, 'DAV:');
166
-
167
-        // Restore previous configuration
168
-        $reader->popContext();
169
-
170
-        $sharee = new self();
171
-        if (!isset($elems['href'])) {
172
-            throw new BadRequest('Every {DAV:}sharee must have a {DAV:}href child-element');
173
-        }
174
-        $sharee->href = $elems['href'];
175
-
176
-        if (isset($elems['prop'])) {
177
-            $sharee->properties = $elems['prop'];
178
-        }
179
-        if (isset($elems['comment'])) {
180
-            $sharee->comment = $elems['comment'];
181
-        }
182
-        if (!isset($elems['share-access'])) {
183
-            throw new BadRequest('Every {DAV:}sharee must have a {DAV:}share-access child element');
184
-        }
185
-        $sharee->access = $elems['share-access']->getValue();
186
-
187
-        return $sharee;
188
-    }
25
+	/**
26
+	 * A URL. Usually a mailto: address, could also be a principal url.
27
+	 * This uniquely identifies the sharee.
28
+	 *
29
+	 * @var string
30
+	 */
31
+	public $href;
32
+
33
+	/**
34
+	 * A local principal path. The server will do its best to locate the
35
+	 * principal uri based on the given uri. If we could find a local matching
36
+	 * principal uri, this property will contain the value.
37
+	 *
38
+	 * @var string|null
39
+	 */
40
+	public $principal;
41
+
42
+	/**
43
+	 * A list of WebDAV properties that describe the sharee. This might for
44
+	 * example contain a {DAV:}displayname with the real name of the user.
45
+	 *
46
+	 * @var array
47
+	 */
48
+	public $properties = [];
49
+
50
+	/**
51
+	 * Share access level. One of the Sabre\DAV\Sharing\Plugin::ACCESS
52
+	 * constants.
53
+	 *
54
+	 * Can be one of:
55
+	 *
56
+	 * ACCESS_READ
57
+	 * ACCESS_READWRITE
58
+	 * ACCESS_SHAREDOWNER
59
+	 * ACCESS_NOACCESS
60
+	 *
61
+	 * depending on context.
62
+	 *
63
+	 * @var int
64
+	 */
65
+	public $access;
66
+
67
+	/**
68
+	 * When a sharee is originally invited to a share, the sharer may add
69
+	 * a comment. This will be placed in this property.
70
+	 *
71
+	 * @var string
72
+	 */
73
+	public $comment;
74
+
75
+	/**
76
+	 * The status of the invite, should be one of the
77
+	 * Sabre\DAV\Sharing\Plugin::INVITE constants.
78
+	 *
79
+	 * @var int
80
+	 */
81
+	public $inviteStatus;
82
+
83
+	/**
84
+	 * Creates the object.
85
+	 *
86
+	 * $properties will be used to populate all internal properties.
87
+	 */
88
+	public function __construct(array $properties = [])
89
+	{
90
+		foreach ($properties as $k => $v) {
91
+			if (property_exists($this, $k)) {
92
+				$this->$k = $v;
93
+			} else {
94
+				throw new \InvalidArgumentException('Unknown property: '.$k);
95
+			}
96
+		}
97
+	}
98
+
99
+	/**
100
+	 * The xmlSerialize method is called during xml writing.
101
+	 *
102
+	 * Use the $writer argument to write its own xml serialization.
103
+	 *
104
+	 * An important note: do _not_ create a parent element. Any element
105
+	 * implementing XmlSerializable should only ever write what's considered
106
+	 * its 'inner xml'.
107
+	 *
108
+	 * The parent of the current element is responsible for writing a
109
+	 * containing element.
110
+	 *
111
+	 * This allows serializers to be re-used for different element names.
112
+	 *
113
+	 * If you are opening new elements, you must also close them again.
114
+	 */
115
+	public function xmlSerialize(Writer $writer)
116
+	{
117
+		$writer->write([
118
+			new Href($this->href),
119
+			'{DAV:}prop' => $this->properties,
120
+			'{DAV:}share-access' => new ShareAccess($this->access),
121
+		]);
122
+		switch ($this->inviteStatus) {
123
+			case Plugin::INVITE_NORESPONSE:
124
+				$writer->writeElement('{DAV:}invite-noresponse');
125
+				break;
126
+			case Plugin::INVITE_ACCEPTED:
127
+				$writer->writeElement('{DAV:}invite-accepted');
128
+				break;
129
+			case Plugin::INVITE_DECLINED:
130
+				$writer->writeElement('{DAV:}invite-declined');
131
+				break;
132
+			case Plugin::INVITE_INVALID:
133
+				$writer->writeElement('{DAV:}invite-invalid');
134
+				break;
135
+		}
136
+	}
137
+
138
+	/**
139
+	 * The deserialize method is called during xml parsing.
140
+	 *
141
+	 * This method is called statically, this is because in theory this method
142
+	 * may be used as a type of constructor, or factory method.
143
+	 *
144
+	 * Often you want to return an instance of the current class, but you are
145
+	 * free to return other data as well.
146
+	 *
147
+	 * You are responsible for advancing the reader to the next element. Not
148
+	 * doing anything will result in a never-ending loop.
149
+	 *
150
+	 * If you just want to skip parsing for this element altogether, you can
151
+	 * just call $reader->next();
152
+	 *
153
+	 * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
154
+	 * the next element.
155
+	 *
156
+	 * @return mixed
157
+	 */
158
+	public static function xmlDeserialize(Reader $reader)
159
+	{
160
+		// Temporarily override configuration
161
+		$reader->pushContext();
162
+		$reader->elementMap['{DAV:}share-access'] = 'Sabre\DAV\Xml\Property\ShareAccess';
163
+		$reader->elementMap['{DAV:}prop'] = 'Sabre\Xml\Deserializer\keyValue';
164
+
165
+		$elems = Deserializer\keyValue($reader, 'DAV:');
166
+
167
+		// Restore previous configuration
168
+		$reader->popContext();
169
+
170
+		$sharee = new self();
171
+		if (!isset($elems['href'])) {
172
+			throw new BadRequest('Every {DAV:}sharee must have a {DAV:}href child-element');
173
+		}
174
+		$sharee->href = $elems['href'];
175
+
176
+		if (isset($elems['prop'])) {
177
+			$sharee->properties = $elems['prop'];
178
+		}
179
+		if (isset($elems['comment'])) {
180
+			$sharee->comment = $elems['comment'];
181
+		}
182
+		if (!isset($elems['share-access'])) {
183
+			throw new BadRequest('Every {DAV:}sharee must have a {DAV:}share-access child element');
184
+		}
185
+		$sharee->access = $elems['share-access']->getValue();
186
+
187
+		return $sharee;
188
+	}
189 189
 }
Please login to merge, or discard this patch.
htdocs/includes/sabre/sabre/dav/lib/DAV/Xml/Element/Response.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -180,7 +180,7 @@
 block discarded – undo
180 180
         // called. But we don't want this, because a singular element without
181 181
         // child-elements implies 'no value' in {DAV:}prop, so we want to skip
182 182
         // deserializers and just set null for those.
183
-        $reader->elementMap['{DAV:}prop'] = function (Reader $reader) {
183
+        $reader->elementMap['{DAV:}prop'] = function(Reader $reader) {
184 184
             if ($reader->isEmptyElement) {
185 185
                 $reader->next();
186 186
 
Please login to merge, or discard this patch.
Indentation   +202 added lines, -202 removed lines patch added patch discarded remove patch
@@ -21,98 +21,98 @@  discard block
 block discarded – undo
21 21
  */
22 22
 class Response implements Element
23 23
 {
24
-    /**
25
-     * Url for the response.
26
-     *
27
-     * @var string
28
-     */
29
-    protected $href;
24
+	/**
25
+	 * Url for the response.
26
+	 *
27
+	 * @var string
28
+	 */
29
+	protected $href;
30 30
 
31
-    /**
32
-     * Propertylist, ordered by HTTP status code.
33
-     *
34
-     * @var array
35
-     */
36
-    protected $responseProperties;
31
+	/**
32
+	 * Propertylist, ordered by HTTP status code.
33
+	 *
34
+	 * @var array
35
+	 */
36
+	protected $responseProperties;
37 37
 
38
-    /**
39
-     * The HTTP status for an entire response.
40
-     *
41
-     * This is currently only used in WebDAV-Sync
42
-     *
43
-     * @var string|null
44
-     */
45
-    protected $httpStatus;
38
+	/**
39
+	 * The HTTP status for an entire response.
40
+	 *
41
+	 * This is currently only used in WebDAV-Sync
42
+	 *
43
+	 * @var string|null
44
+	 */
45
+	protected $httpStatus;
46 46
 
47
-    /**
48
-     * The href argument is a url relative to the root of the server. This
49
-     * class will calculate the full path.
50
-     *
51
-     * The responseProperties argument is a list of properties
52
-     * within an array with keys representing HTTP status codes
53
-     *
54
-     * Besides specific properties, the entire {DAV:}response element may also
55
-     * have a http status code.
56
-     * In most cases you don't need it.
57
-     *
58
-     * This is currently used by the Sync extension to indicate that a node is
59
-     * deleted.
60
-     *
61
-     * @param string $href
62
-     * @param string $httpStatus
63
-     */
64
-    public function __construct($href, array $responseProperties, $httpStatus = null)
65
-    {
66
-        $this->href = $href;
67
-        $this->responseProperties = $responseProperties;
68
-        $this->httpStatus = $httpStatus;
69
-    }
47
+	/**
48
+	 * The href argument is a url relative to the root of the server. This
49
+	 * class will calculate the full path.
50
+	 *
51
+	 * The responseProperties argument is a list of properties
52
+	 * within an array with keys representing HTTP status codes
53
+	 *
54
+	 * Besides specific properties, the entire {DAV:}response element may also
55
+	 * have a http status code.
56
+	 * In most cases you don't need it.
57
+	 *
58
+	 * This is currently used by the Sync extension to indicate that a node is
59
+	 * deleted.
60
+	 *
61
+	 * @param string $href
62
+	 * @param string $httpStatus
63
+	 */
64
+	public function __construct($href, array $responseProperties, $httpStatus = null)
65
+	{
66
+		$this->href = $href;
67
+		$this->responseProperties = $responseProperties;
68
+		$this->httpStatus = $httpStatus;
69
+	}
70 70
 
71
-    /**
72
-     * Returns the url.
73
-     *
74
-     * @return string
75
-     */
76
-    public function getHref()
77
-    {
78
-        return $this->href;
79
-    }
71
+	/**
72
+	 * Returns the url.
73
+	 *
74
+	 * @return string
75
+	 */
76
+	public function getHref()
77
+	{
78
+		return $this->href;
79
+	}
80 80
 
81
-    /**
82
-     * Returns the httpStatus value.
83
-     *
84
-     * @return string
85
-     */
86
-    public function getHttpStatus()
87
-    {
88
-        return $this->httpStatus;
89
-    }
81
+	/**
82
+	 * Returns the httpStatus value.
83
+	 *
84
+	 * @return string
85
+	 */
86
+	public function getHttpStatus()
87
+	{
88
+		return $this->httpStatus;
89
+	}
90 90
 
91
-    /**
92
-     * Returns the property list.
93
-     *
94
-     * @return array
95
-     */
96
-    public function getResponseProperties()
97
-    {
98
-        return $this->responseProperties;
99
-    }
91
+	/**
92
+	 * Returns the property list.
93
+	 *
94
+	 * @return array
95
+	 */
96
+	public function getResponseProperties()
97
+	{
98
+		return $this->responseProperties;
99
+	}
100 100
 
101
-    /**
102
-     * The serialize method is called during xml writing.
103
-     *
104
-     * It should use the $writer argument to encode this object into XML.
105
-     *
106
-     * Important note: it is not needed to create the parent element. The
107
-     * parent element is already created, and we only have to worry about
108
-     * attributes, child elements and text (if any).
109
-     *
110
-     * Important note 2: If you are writing any new elements, you are also
111
-     * responsible for closing them.
112
-     */
113
-    public function xmlSerialize(Writer $writer)
114
-    {
115
-        /*
101
+	/**
102
+	 * The serialize method is called during xml writing.
103
+	 *
104
+	 * It should use the $writer argument to encode this object into XML.
105
+	 *
106
+	 * Important note: it is not needed to create the parent element. The
107
+	 * parent element is already created, and we only have to worry about
108
+	 * attributes, child elements and text (if any).
109
+	 *
110
+	 * Important note 2: If you are writing any new elements, you are also
111
+	 * responsible for closing them.
112
+	 */
113
+	public function xmlSerialize(Writer $writer)
114
+	{
115
+		/*
116 116
          * Accordingly to the RFC the element looks like:
117 117
          * <!ELEMENT response (href, ((href*, status)|(propstat+)), error?, responsedescription? , location?) >
118 118
          *
@@ -121,30 +121,30 @@  discard block
 block discarded – undo
121 121
          *   - EITHER a status and additional href(s)
122 122
          *     OR one or more propstat(s)
123 123
          */
124
-        $writer->writeElement('{DAV:}href', $writer->contextUri.\Sabre\HTTP\encodePath($this->getHref()));
124
+		$writer->writeElement('{DAV:}href', $writer->contextUri.\Sabre\HTTP\encodePath($this->getHref()));
125 125
 
126
-        $empty = true;
127
-        $httpStatus = $this->getHTTPStatus();
126
+		$empty = true;
127
+		$httpStatus = $this->getHTTPStatus();
128 128
 
129
-        // Add propstat elements
130
-        foreach ($this->getResponseProperties() as $status => $properties) {
131
-            // Skipping empty lists
132
-            if (!$properties || (!is_int($status) && !ctype_digit($status))) {
133
-                continue;
134
-            }
135
-            $empty = false;
136
-            $writer->startElement('{DAV:}propstat');
137
-            $writer->writeElement('{DAV:}prop', $properties);
138
-            $writer->writeElement('{DAV:}status', 'HTTP/1.1 '.$status.' '.\Sabre\HTTP\Response::$statusCodes[$status]);
139
-            $writer->endElement(); // {DAV:}propstat
140
-        }
129
+		// Add propstat elements
130
+		foreach ($this->getResponseProperties() as $status => $properties) {
131
+			// Skipping empty lists
132
+			if (!$properties || (!is_int($status) && !ctype_digit($status))) {
133
+				continue;
134
+			}
135
+			$empty = false;
136
+			$writer->startElement('{DAV:}propstat');
137
+			$writer->writeElement('{DAV:}prop', $properties);
138
+			$writer->writeElement('{DAV:}status', 'HTTP/1.1 '.$status.' '.\Sabre\HTTP\Response::$statusCodes[$status]);
139
+			$writer->endElement(); // {DAV:}propstat
140
+		}
141 141
 
142
-        // The WebDAV spec only allows the status element on responses _without_ a propstat
143
-        if ($empty) {
144
-            if (null !== $httpStatus) {
145
-                $writer->writeElement('{DAV:}status', 'HTTP/1.1 '.$httpStatus.' '.\Sabre\HTTP\Response::$statusCodes[$httpStatus]);
146
-            } else {
147
-                /*
142
+		// The WebDAV spec only allows the status element on responses _without_ a propstat
143
+		if ($empty) {
144
+			if (null !== $httpStatus) {
145
+				$writer->writeElement('{DAV:}status', 'HTTP/1.1 '.$httpStatus.' '.\Sabre\HTTP\Response::$statusCodes[$httpStatus]);
146
+			} else {
147
+				/*
148 148
                 * The WebDAV spec _requires_ at least one DAV:propstat to appear for
149 149
                 * every DAV:response if there is no status.
150 150
                 * In some circumstances however, there are no properties to encode.
@@ -152,116 +152,116 @@  discard block
 block discarded – undo
152 152
                 * In those cases we MUST specify at least one DAV:propstat anyway, with
153 153
                 * no properties.
154 154
                 */
155
-                $writer->writeElement('{DAV:}propstat', [
156
-                    '{DAV:}prop' => [],
157
-                    '{DAV:}status' => 'HTTP/1.1 418 '.\Sabre\HTTP\Response::$statusCodes[418],
158
-                ]);
159
-            }
160
-        }
161
-    }
155
+				$writer->writeElement('{DAV:}propstat', [
156
+					'{DAV:}prop' => [],
157
+					'{DAV:}status' => 'HTTP/1.1 418 '.\Sabre\HTTP\Response::$statusCodes[418],
158
+				]);
159
+			}
160
+		}
161
+	}
162 162
 
163
-    /**
164
-     * The deserialize method is called during xml parsing.
165
-     *
166
-     * This method is called statically, this is because in theory this method
167
-     * may be used as a type of constructor, or factory method.
168
-     *
169
-     * Often you want to return an instance of the current class, but you are
170
-     * free to return other data as well.
171
-     *
172
-     * You are responsible for advancing the reader to the next element. Not
173
-     * doing anything will result in a never-ending loop.
174
-     *
175
-     * If you just want to skip parsing for this element altogether, you can
176
-     * just call $reader->next();
177
-     *
178
-     * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
179
-     * the next element.
180
-     *
181
-     * @return mixed
182
-     */
183
-    public static function xmlDeserialize(Reader $reader)
184
-    {
185
-        $reader->pushContext();
163
+	/**
164
+	 * The deserialize method is called during xml parsing.
165
+	 *
166
+	 * This method is called statically, this is because in theory this method
167
+	 * may be used as a type of constructor, or factory method.
168
+	 *
169
+	 * Often you want to return an instance of the current class, but you are
170
+	 * free to return other data as well.
171
+	 *
172
+	 * You are responsible for advancing the reader to the next element. Not
173
+	 * doing anything will result in a never-ending loop.
174
+	 *
175
+	 * If you just want to skip parsing for this element altogether, you can
176
+	 * just call $reader->next();
177
+	 *
178
+	 * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
179
+	 * the next element.
180
+	 *
181
+	 * @return mixed
182
+	 */
183
+	public static function xmlDeserialize(Reader $reader)
184
+	{
185
+		$reader->pushContext();
186 186
 
187
-        $reader->elementMap['{DAV:}propstat'] = 'Sabre\\Xml\\Element\\KeyValue';
187
+		$reader->elementMap['{DAV:}propstat'] = 'Sabre\\Xml\\Element\\KeyValue';
188 188
 
189
-        // We are overriding the parser for {DAV:}prop. This deserializer is
190
-        // almost identical to the one for Sabre\Xml\Element\KeyValue.
191
-        //
192
-        // The difference is that if there are any child-elements inside of
193
-        // {DAV:}prop, that have no value, normally any deserializers are
194
-        // called. But we don't want this, because a singular element without
195
-        // child-elements implies 'no value' in {DAV:}prop, so we want to skip
196
-        // deserializers and just set null for those.
197
-        $reader->elementMap['{DAV:}prop'] = function (Reader $reader) {
198
-            if ($reader->isEmptyElement) {
199
-                $reader->next();
189
+		// We are overriding the parser for {DAV:}prop. This deserializer is
190
+		// almost identical to the one for Sabre\Xml\Element\KeyValue.
191
+		//
192
+		// The difference is that if there are any child-elements inside of
193
+		// {DAV:}prop, that have no value, normally any deserializers are
194
+		// called. But we don't want this, because a singular element without
195
+		// child-elements implies 'no value' in {DAV:}prop, so we want to skip
196
+		// deserializers and just set null for those.
197
+		$reader->elementMap['{DAV:}prop'] = function (Reader $reader) {
198
+			if ($reader->isEmptyElement) {
199
+				$reader->next();
200 200
 
201
-                return [];
202
-            }
201
+				return [];
202
+			}
203 203
 
204
-            if (!$reader->read()) {
205
-                $reader->next();
204
+			if (!$reader->read()) {
205
+				$reader->next();
206 206
 
207
-                return [];
208
-            }
207
+				return [];
208
+			}
209 209
 
210
-            if (Reader::END_ELEMENT === $reader->nodeType) {
211
-                $reader->next();
210
+			if (Reader::END_ELEMENT === $reader->nodeType) {
211
+				$reader->next();
212 212
 
213
-                return [];
214
-            }
213
+				return [];
214
+			}
215 215
 
216
-            $values = [];
216
+			$values = [];
217 217
 
218
-            do {
219
-                if (Reader::ELEMENT === $reader->nodeType) {
220
-                    $clark = $reader->getClark();
218
+			do {
219
+				if (Reader::ELEMENT === $reader->nodeType) {
220
+					$clark = $reader->getClark();
221 221
 
222
-                    if ($reader->isEmptyElement) {
223
-                        $values[$clark] = null;
224
-                        $reader->next();
225
-                    } else {
226
-                        $values[$clark] = $reader->parseCurrentElement()['value'];
227
-                    }
228
-                } else {
229
-                    if (!$reader->read()) {
230
-                        break;
231
-                    }
232
-                }
233
-            } while (Reader::END_ELEMENT !== $reader->nodeType);
222
+					if ($reader->isEmptyElement) {
223
+						$values[$clark] = null;
224
+						$reader->next();
225
+					} else {
226
+						$values[$clark] = $reader->parseCurrentElement()['value'];
227
+					}
228
+				} else {
229
+					if (!$reader->read()) {
230
+						break;
231
+					}
232
+				}
233
+			} while (Reader::END_ELEMENT !== $reader->nodeType);
234 234
 
235
-            $reader->read();
235
+			$reader->read();
236 236
 
237
-            return $values;
238
-        };
239
-        $elems = $reader->parseInnerTree();
240
-        $reader->popContext();
237
+			return $values;
238
+		};
239
+		$elems = $reader->parseInnerTree();
240
+		$reader->popContext();
241 241
 
242
-        $href = null;
243
-        $propertyLists = [];
244
-        $statusCode = null;
242
+		$href = null;
243
+		$propertyLists = [];
244
+		$statusCode = null;
245 245
 
246
-        foreach ($elems as $elem) {
247
-            switch ($elem['name']) {
248
-                case '{DAV:}href':
249
-                    $href = $elem['value'];
250
-                    break;
251
-                case '{DAV:}propstat':
252
-                    $status = $elem['value']['{DAV:}status'];
253
-                    list(, $status) = explode(' ', $status, 3);
254
-                    $properties = isset($elem['value']['{DAV:}prop']) ? $elem['value']['{DAV:}prop'] : [];
255
-                    if ($properties) {
256
-                        $propertyLists[$status] = $properties;
257
-                    }
258
-                    break;
259
-                case '{DAV:}status':
260
-                    list(, $statusCode) = explode(' ', $elem['value'], 3);
261
-                    break;
262
-            }
263
-        }
246
+		foreach ($elems as $elem) {
247
+			switch ($elem['name']) {
248
+				case '{DAV:}href':
249
+					$href = $elem['value'];
250
+					break;
251
+				case '{DAV:}propstat':
252
+					$status = $elem['value']['{DAV:}status'];
253
+					list(, $status) = explode(' ', $status, 3);
254
+					$properties = isset($elem['value']['{DAV:}prop']) ? $elem['value']['{DAV:}prop'] : [];
255
+					if ($properties) {
256
+						$propertyLists[$status] = $properties;
257
+					}
258
+					break;
259
+				case '{DAV:}status':
260
+					list(, $statusCode) = explode(' ', $elem['value'], 3);
261
+					break;
262
+			}
263
+		}
264 264
 
265
-        return new self($href, $propertyLists, $statusCode);
266
-    }
265
+		return new self($href, $propertyLists, $statusCode);
266
+	}
267 267
 }
Please login to merge, or discard this patch.
htdocs/includes/sabre/sabre/dav/lib/DAV/Xml/Element/Prop.php 1 patch
Indentation   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -21,90 +21,90 @@
 block discarded – undo
21 21
  */
22 22
 class Prop implements XmlDeserializable
23 23
 {
24
-    /**
25
-     * The deserialize method is called during xml parsing.
26
-     *
27
-     * This method is called statically, this is because in theory this method
28
-     * may be used as a type of constructor, or factory method.
29
-     *
30
-     * Often you want to return an instance of the current class, but you are
31
-     * free to return other data as well.
32
-     *
33
-     * You are responsible for advancing the reader to the next element. Not
34
-     * doing anything will result in a never-ending loop.
35
-     *
36
-     * If you just want to skip parsing for this element altogether, you can
37
-     * just call $reader->next();
38
-     *
39
-     * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
40
-     * the next element.
41
-     *
42
-     * @return mixed
43
-     */
44
-    public static function xmlDeserialize(Reader $reader)
45
-    {
46
-        // If there's no children, we don't do anything.
47
-        if ($reader->isEmptyElement) {
48
-            $reader->next();
24
+	/**
25
+	 * The deserialize method is called during xml parsing.
26
+	 *
27
+	 * This method is called statically, this is because in theory this method
28
+	 * may be used as a type of constructor, or factory method.
29
+	 *
30
+	 * Often you want to return an instance of the current class, but you are
31
+	 * free to return other data as well.
32
+	 *
33
+	 * You are responsible for advancing the reader to the next element. Not
34
+	 * doing anything will result in a never-ending loop.
35
+	 *
36
+	 * If you just want to skip parsing for this element altogether, you can
37
+	 * just call $reader->next();
38
+	 *
39
+	 * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
40
+	 * the next element.
41
+	 *
42
+	 * @return mixed
43
+	 */
44
+	public static function xmlDeserialize(Reader $reader)
45
+	{
46
+		// If there's no children, we don't do anything.
47
+		if ($reader->isEmptyElement) {
48
+			$reader->next();
49 49
 
50
-            return [];
51
-        }
50
+			return [];
51
+		}
52 52
 
53
-        $values = [];
53
+		$values = [];
54 54
 
55
-        $reader->read();
56
-        do {
57
-            if (Reader::ELEMENT === $reader->nodeType) {
58
-                $clark = $reader->getClark();
59
-                $values[$clark] = self::parseCurrentElement($reader)['value'];
60
-            } else {
61
-                $reader->read();
62
-            }
63
-        } while (Reader::END_ELEMENT !== $reader->nodeType);
55
+		$reader->read();
56
+		do {
57
+			if (Reader::ELEMENT === $reader->nodeType) {
58
+				$clark = $reader->getClark();
59
+				$values[$clark] = self::parseCurrentElement($reader)['value'];
60
+			} else {
61
+				$reader->read();
62
+			}
63
+		} while (Reader::END_ELEMENT !== $reader->nodeType);
64 64
 
65
-        $reader->read();
65
+		$reader->read();
66 66
 
67
-        return $values;
68
-    }
67
+		return $values;
68
+	}
69 69
 
70
-    /**
71
-     * This function behaves similar to Sabre\Xml\Reader::parseCurrentElement,
72
-     * but instead of creating deep xml array structures, it will turn any
73
-     * top-level element it doesn't recognize into either a string, or an
74
-     * XmlFragment class.
75
-     *
76
-     * This method returns arn array with 2 properties:
77
-     *   * name - A clark-notation XML element name.
78
-     *   * value - The parsed value.
79
-     *
80
-     * @return array
81
-     */
82
-    private static function parseCurrentElement(Reader $reader)
83
-    {
84
-        $name = $reader->getClark();
70
+	/**
71
+	 * This function behaves similar to Sabre\Xml\Reader::parseCurrentElement,
72
+	 * but instead of creating deep xml array structures, it will turn any
73
+	 * top-level element it doesn't recognize into either a string, or an
74
+	 * XmlFragment class.
75
+	 *
76
+	 * This method returns arn array with 2 properties:
77
+	 *   * name - A clark-notation XML element name.
78
+	 *   * value - The parsed value.
79
+	 *
80
+	 * @return array
81
+	 */
82
+	private static function parseCurrentElement(Reader $reader)
83
+	{
84
+		$name = $reader->getClark();
85 85
 
86
-        if (array_key_exists($name, $reader->elementMap)) {
87
-            $deserializer = $reader->elementMap[$name];
88
-            if (is_subclass_of($deserializer, 'Sabre\\Xml\\XmlDeserializable')) {
89
-                $value = call_user_func([$deserializer, 'xmlDeserialize'], $reader);
90
-            } elseif (is_callable($deserializer)) {
91
-                $value = call_user_func($deserializer, $reader);
92
-            } else {
93
-                $type = gettype($deserializer);
94
-                if ('string' === $type) {
95
-                    $type .= ' ('.$deserializer.')';
96
-                } elseif ('object' === $type) {
97
-                    $type .= ' ('.get_class($deserializer).')';
98
-                }
99
-                throw new \LogicException('Could not use this type as a deserializer: '.$type);
100
-            }
101
-        } else {
102
-            $value = Complex::xmlDeserialize($reader);
103
-        }
86
+		if (array_key_exists($name, $reader->elementMap)) {
87
+			$deserializer = $reader->elementMap[$name];
88
+			if (is_subclass_of($deserializer, 'Sabre\\Xml\\XmlDeserializable')) {
89
+				$value = call_user_func([$deserializer, 'xmlDeserialize'], $reader);
90
+			} elseif (is_callable($deserializer)) {
91
+				$value = call_user_func($deserializer, $reader);
92
+			} else {
93
+				$type = gettype($deserializer);
94
+				if ('string' === $type) {
95
+					$type .= ' ('.$deserializer.')';
96
+				} elseif ('object' === $type) {
97
+					$type .= ' ('.get_class($deserializer).')';
98
+				}
99
+				throw new \LogicException('Could not use this type as a deserializer: '.$type);
100
+			}
101
+		} else {
102
+			$value = Complex::xmlDeserialize($reader);
103
+		}
104 104
 
105
-        return [
106
-            'name' => $name,
107
-            'value' => $value,
108
-        ];
109
-    }
105
+		return [
106
+			'name' => $name,
107
+			'value' => $value,
108
+		];
109
+	}
110 110
 }
Please login to merge, or discard this patch.
htdocs/includes/sabre/sabre/dav/lib/DAV/Xml/Request/Lock.php 1 patch
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -22,63 +22,63 @@
 block discarded – undo
22 22
  */
23 23
 class Lock implements XmlDeserializable
24 24
 {
25
-    /**
26
-     * Owner of the lock.
27
-     *
28
-     * @var string
29
-     */
30
-    public $owner;
25
+	/**
26
+	 * Owner of the lock.
27
+	 *
28
+	 * @var string
29
+	 */
30
+	public $owner;
31 31
 
32
-    /**
33
-     * Scope of the lock.
34
-     *
35
-     * Either LockInfo::SHARED or LockInfo::EXCLUSIVE
36
-     *
37
-     * @var int
38
-     */
39
-    public $scope;
32
+	/**
33
+	 * Scope of the lock.
34
+	 *
35
+	 * Either LockInfo::SHARED or LockInfo::EXCLUSIVE
36
+	 *
37
+	 * @var int
38
+	 */
39
+	public $scope;
40 40
 
41
-    /**
42
-     * The deserialize method is called during xml parsing.
43
-     *
44
-     * This method is called statically, this is because in theory this method
45
-     * may be used as a type of constructor, or factory method.
46
-     *
47
-     * Often you want to return an instance of the current class, but you are
48
-     * free to return other data as well.
49
-     *
50
-     * You are responsible for advancing the reader to the next element. Not
51
-     * doing anything will result in a never-ending loop.
52
-     *
53
-     * If you just want to skip parsing for this element altogether, you can
54
-     * just call $reader->next();
55
-     *
56
-     * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
57
-     * the next element.
58
-     *
59
-     * @return mixed
60
-     */
61
-    public static function xmlDeserialize(Reader $reader)
62
-    {
63
-        $reader->pushContext();
64
-        $reader->elementMap['{DAV:}owner'] = 'Sabre\\Xml\\Element\\XmlFragment';
41
+	/**
42
+	 * The deserialize method is called during xml parsing.
43
+	 *
44
+	 * This method is called statically, this is because in theory this method
45
+	 * may be used as a type of constructor, or factory method.
46
+	 *
47
+	 * Often you want to return an instance of the current class, but you are
48
+	 * free to return other data as well.
49
+	 *
50
+	 * You are responsible for advancing the reader to the next element. Not
51
+	 * doing anything will result in a never-ending loop.
52
+	 *
53
+	 * If you just want to skip parsing for this element altogether, you can
54
+	 * just call $reader->next();
55
+	 *
56
+	 * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
57
+	 * the next element.
58
+	 *
59
+	 * @return mixed
60
+	 */
61
+	public static function xmlDeserialize(Reader $reader)
62
+	{
63
+		$reader->pushContext();
64
+		$reader->elementMap['{DAV:}owner'] = 'Sabre\\Xml\\Element\\XmlFragment';
65 65
 
66
-        $values = KeyValue::xmlDeserialize($reader);
66
+		$values = KeyValue::xmlDeserialize($reader);
67 67
 
68
-        $reader->popContext();
68
+		$reader->popContext();
69 69
 
70
-        $new = new self();
71
-        $new->owner = !empty($values['{DAV:}owner']) ? $values['{DAV:}owner']->getXml() : null;
72
-        $new->scope = LockInfo::SHARED;
70
+		$new = new self();
71
+		$new->owner = !empty($values['{DAV:}owner']) ? $values['{DAV:}owner']->getXml() : null;
72
+		$new->scope = LockInfo::SHARED;
73 73
 
74
-        if (isset($values['{DAV:}lockscope'])) {
75
-            foreach ($values['{DAV:}lockscope'] as $elem) {
76
-                if ('{DAV:}exclusive' === $elem['name']) {
77
-                    $new->scope = LockInfo::EXCLUSIVE;
78
-                }
79
-            }
80
-        }
74
+		if (isset($values['{DAV:}lockscope'])) {
75
+			foreach ($values['{DAV:}lockscope'] as $elem) {
76
+				if ('{DAV:}exclusive' === $elem['name']) {
77
+					$new->scope = LockInfo::EXCLUSIVE;
78
+				}
79
+			}
80
+		}
81 81
 
82
-        return $new;
83
-    }
82
+		return $new;
83
+	}
84 84
 }
Please login to merge, or discard this patch.
htdocs/includes/sabre/sabre/dav/lib/DAV/Xml/Request/PropPatch.php 1 patch
Indentation   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -21,89 +21,89 @@
 block discarded – undo
21 21
  */
22 22
 class PropPatch implements Element
23 23
 {
24
-    /**
25
-     * The list of properties that will be updated and removed.
26
-     *
27
-     * If a property will be removed, it's value will be set to null.
28
-     *
29
-     * @var array
30
-     */
31
-    public $properties = [];
24
+	/**
25
+	 * The list of properties that will be updated and removed.
26
+	 *
27
+	 * If a property will be removed, it's value will be set to null.
28
+	 *
29
+	 * @var array
30
+	 */
31
+	public $properties = [];
32 32
 
33
-    /**
34
-     * The xmlSerialize method is called during xml writing.
35
-     *
36
-     * Use the $writer argument to write its own xml serialization.
37
-     *
38
-     * An important note: do _not_ create a parent element. Any element
39
-     * implementing XmlSerializable should only ever write what's considered
40
-     * its 'inner xml'.
41
-     *
42
-     * The parent of the current element is responsible for writing a
43
-     * containing element.
44
-     *
45
-     * This allows serializers to be re-used for different element names.
46
-     *
47
-     * If you are opening new elements, you must also close them again.
48
-     */
49
-    public function xmlSerialize(Writer $writer)
50
-    {
51
-        foreach ($this->properties as $propertyName => $propertyValue) {
52
-            if (is_null($propertyValue)) {
53
-                $writer->startElement('{DAV:}remove');
54
-                $writer->write(['{DAV:}prop' => [$propertyName => $propertyValue]]);
55
-                $writer->endElement();
56
-            } else {
57
-                $writer->startElement('{DAV:}set');
58
-                $writer->write(['{DAV:}prop' => [$propertyName => $propertyValue]]);
59
-                $writer->endElement();
60
-            }
61
-        }
62
-    }
33
+	/**
34
+	 * The xmlSerialize method is called during xml writing.
35
+	 *
36
+	 * Use the $writer argument to write its own xml serialization.
37
+	 *
38
+	 * An important note: do _not_ create a parent element. Any element
39
+	 * implementing XmlSerializable should only ever write what's considered
40
+	 * its 'inner xml'.
41
+	 *
42
+	 * The parent of the current element is responsible for writing a
43
+	 * containing element.
44
+	 *
45
+	 * This allows serializers to be re-used for different element names.
46
+	 *
47
+	 * If you are opening new elements, you must also close them again.
48
+	 */
49
+	public function xmlSerialize(Writer $writer)
50
+	{
51
+		foreach ($this->properties as $propertyName => $propertyValue) {
52
+			if (is_null($propertyValue)) {
53
+				$writer->startElement('{DAV:}remove');
54
+				$writer->write(['{DAV:}prop' => [$propertyName => $propertyValue]]);
55
+				$writer->endElement();
56
+			} else {
57
+				$writer->startElement('{DAV:}set');
58
+				$writer->write(['{DAV:}prop' => [$propertyName => $propertyValue]]);
59
+				$writer->endElement();
60
+			}
61
+		}
62
+	}
63 63
 
64
-    /**
65
-     * The deserialize method is called during xml parsing.
66
-     *
67
-     * This method is called statically, this is because in theory this method
68
-     * may be used as a type of constructor, or factory method.
69
-     *
70
-     * Often you want to return an instance of the current class, but you are
71
-     * free to return other data as well.
72
-     *
73
-     * You are responsible for advancing the reader to the next element. Not
74
-     * doing anything will result in a never-ending loop.
75
-     *
76
-     * If you just want to skip parsing for this element altogether, you can
77
-     * just call $reader->next();
78
-     *
79
-     * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
80
-     * the next element.
81
-     *
82
-     * @return mixed
83
-     */
84
-    public static function xmlDeserialize(Reader $reader)
85
-    {
86
-        $self = new self();
64
+	/**
65
+	 * The deserialize method is called during xml parsing.
66
+	 *
67
+	 * This method is called statically, this is because in theory this method
68
+	 * may be used as a type of constructor, or factory method.
69
+	 *
70
+	 * Often you want to return an instance of the current class, but you are
71
+	 * free to return other data as well.
72
+	 *
73
+	 * You are responsible for advancing the reader to the next element. Not
74
+	 * doing anything will result in a never-ending loop.
75
+	 *
76
+	 * If you just want to skip parsing for this element altogether, you can
77
+	 * just call $reader->next();
78
+	 *
79
+	 * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
80
+	 * the next element.
81
+	 *
82
+	 * @return mixed
83
+	 */
84
+	public static function xmlDeserialize(Reader $reader)
85
+	{
86
+		$self = new self();
87 87
 
88
-        $elementMap = $reader->elementMap;
89
-        $elementMap['{DAV:}prop'] = 'Sabre\DAV\Xml\Element\Prop';
90
-        $elementMap['{DAV:}set'] = 'Sabre\Xml\Element\KeyValue';
91
-        $elementMap['{DAV:}remove'] = 'Sabre\Xml\Element\KeyValue';
88
+		$elementMap = $reader->elementMap;
89
+		$elementMap['{DAV:}prop'] = 'Sabre\DAV\Xml\Element\Prop';
90
+		$elementMap['{DAV:}set'] = 'Sabre\Xml\Element\KeyValue';
91
+		$elementMap['{DAV:}remove'] = 'Sabre\Xml\Element\KeyValue';
92 92
 
93
-        $elems = $reader->parseInnerTree($elementMap);
93
+		$elems = $reader->parseInnerTree($elementMap);
94 94
 
95
-        foreach ($elems as $elem) {
96
-            if ('{DAV:}set' === $elem['name']) {
97
-                $self->properties = array_merge($self->properties, $elem['value']['{DAV:}prop']);
98
-            }
99
-            if ('{DAV:}remove' === $elem['name']) {
100
-                // Ensuring there are no values.
101
-                foreach ($elem['value']['{DAV:}prop'] as $remove => $value) {
102
-                    $self->properties[$remove] = null;
103
-                }
104
-            }
105
-        }
95
+		foreach ($elems as $elem) {
96
+			if ('{DAV:}set' === $elem['name']) {
97
+				$self->properties = array_merge($self->properties, $elem['value']['{DAV:}prop']);
98
+			}
99
+			if ('{DAV:}remove' === $elem['name']) {
100
+				// Ensuring there are no values.
101
+				foreach ($elem['value']['{DAV:}prop'] as $remove => $value) {
102
+					$self->properties[$remove] = null;
103
+				}
104
+			}
105
+		}
106 106
 
107
-        return $self;
108
-    }
107
+		return $self;
108
+	}
109 109
 }
Please login to merge, or discard this patch.
htdocs/includes/sabre/sabre/dav/lib/DAV/Xml/Request/MkCol.php 1 patch
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -20,61 +20,61 @@
 block discarded – undo
20 20
  */
21 21
 class MkCol implements XmlDeserializable
22 22
 {
23
-    /**
24
-     * The list of properties that will be set.
25
-     *
26
-     * @var array
27
-     */
28
-    protected $properties = [];
23
+	/**
24
+	 * The list of properties that will be set.
25
+	 *
26
+	 * @var array
27
+	 */
28
+	protected $properties = [];
29 29
 
30
-    /**
31
-     * Returns a key=>value array with properties that are supposed to get set
32
-     * during creation of the new collection.
33
-     *
34
-     * @return array
35
-     */
36
-    public function getProperties()
37
-    {
38
-        return $this->properties;
39
-    }
30
+	/**
31
+	 * Returns a key=>value array with properties that are supposed to get set
32
+	 * during creation of the new collection.
33
+	 *
34
+	 * @return array
35
+	 */
36
+	public function getProperties()
37
+	{
38
+		return $this->properties;
39
+	}
40 40
 
41
-    /**
42
-     * The deserialize method is called during xml parsing.
43
-     *
44
-     * This method is called statically, this is because in theory this method
45
-     * may be used as a type of constructor, or factory method.
46
-     *
47
-     * Often you want to return an instance of the current class, but you are
48
-     * free to return other data as well.
49
-     *
50
-     * You are responsible for advancing the reader to the next element. Not
51
-     * doing anything will result in a never-ending loop.
52
-     *
53
-     * If you just want to skip parsing for this element altogether, you can
54
-     * just call $reader->next();
55
-     *
56
-     * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
57
-     * the next element.
58
-     *
59
-     * @return mixed
60
-     */
61
-    public static function xmlDeserialize(Reader $reader)
62
-    {
63
-        $self = new self();
41
+	/**
42
+	 * The deserialize method is called during xml parsing.
43
+	 *
44
+	 * This method is called statically, this is because in theory this method
45
+	 * may be used as a type of constructor, or factory method.
46
+	 *
47
+	 * Often you want to return an instance of the current class, but you are
48
+	 * free to return other data as well.
49
+	 *
50
+	 * You are responsible for advancing the reader to the next element. Not
51
+	 * doing anything will result in a never-ending loop.
52
+	 *
53
+	 * If you just want to skip parsing for this element altogether, you can
54
+	 * just call $reader->next();
55
+	 *
56
+	 * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
57
+	 * the next element.
58
+	 *
59
+	 * @return mixed
60
+	 */
61
+	public static function xmlDeserialize(Reader $reader)
62
+	{
63
+		$self = new self();
64 64
 
65
-        $elementMap = $reader->elementMap;
66
-        $elementMap['{DAV:}prop'] = 'Sabre\DAV\Xml\Element\Prop';
67
-        $elementMap['{DAV:}set'] = 'Sabre\Xml\Element\KeyValue';
68
-        $elementMap['{DAV:}remove'] = 'Sabre\Xml\Element\KeyValue';
65
+		$elementMap = $reader->elementMap;
66
+		$elementMap['{DAV:}prop'] = 'Sabre\DAV\Xml\Element\Prop';
67
+		$elementMap['{DAV:}set'] = 'Sabre\Xml\Element\KeyValue';
68
+		$elementMap['{DAV:}remove'] = 'Sabre\Xml\Element\KeyValue';
69 69
 
70
-        $elems = $reader->parseInnerTree($elementMap);
70
+		$elems = $reader->parseInnerTree($elementMap);
71 71
 
72
-        foreach ($elems as $elem) {
73
-            if ('{DAV:}set' === $elem['name']) {
74
-                $self->properties = array_merge($self->properties, $elem['value']['{DAV:}prop']);
75
-            }
76
-        }
72
+		foreach ($elems as $elem) {
73
+			if ('{DAV:}set' === $elem['name']) {
74
+				$self->properties = array_merge($self->properties, $elem['value']['{DAV:}prop']);
75
+			}
76
+		}
77 77
 
78
-        return $self;
79
-    }
78
+		return $self;
79
+	}
80 80
 }
Please login to merge, or discard this patch.
htdocs/includes/sabre/sabre/dav/lib/DAV/Xml/Request/ShareResource.php 1 patch
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -21,60 +21,60 @@
 block discarded – undo
21 21
  */
22 22
 class ShareResource implements XmlDeserializable
23 23
 {
24
-    /**
25
-     * The list of new people added or updated or removed from the share.
26
-     *
27
-     * @var Sharee[]
28
-     */
29
-    public $sharees = [];
24
+	/**
25
+	 * The list of new people added or updated or removed from the share.
26
+	 *
27
+	 * @var Sharee[]
28
+	 */
29
+	public $sharees = [];
30 30
 
31
-    /**
32
-     * Constructor.
33
-     *
34
-     * @param Sharee[] $sharees
35
-     */
36
-    public function __construct(array $sharees)
37
-    {
38
-        $this->sharees = $sharees;
39
-    }
31
+	/**
32
+	 * Constructor.
33
+	 *
34
+	 * @param Sharee[] $sharees
35
+	 */
36
+	public function __construct(array $sharees)
37
+	{
38
+		$this->sharees = $sharees;
39
+	}
40 40
 
41
-    /**
42
-     * The deserialize method is called during xml parsing.
43
-     *
44
-     * This method is called statically, this is because in theory this method
45
-     * may be used as a type of constructor, or factory method.
46
-     *
47
-     * Often you want to return an instance of the current class, but you are
48
-     * free to return other data as well.
49
-     *
50
-     * You are responsible for advancing the reader to the next element. Not
51
-     * doing anything will result in a never-ending loop.
52
-     *
53
-     * If you just want to skip parsing for this element altogether, you can
54
-     * just call $reader->next();
55
-     *
56
-     * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
57
-     * the next element.
58
-     *
59
-     * @return mixed
60
-     */
61
-    public static function xmlDeserialize(Reader $reader)
62
-    {
63
-        $elems = $reader->parseInnerTree([
64
-            '{DAV:}sharee' => 'Sabre\DAV\Xml\Element\Sharee',
65
-            '{DAV:}share-access' => 'Sabre\DAV\Xml\Property\ShareAccess',
66
-            '{DAV:}prop' => 'Sabre\Xml\Deserializer\keyValue',
67
-        ]);
41
+	/**
42
+	 * The deserialize method is called during xml parsing.
43
+	 *
44
+	 * This method is called statically, this is because in theory this method
45
+	 * may be used as a type of constructor, or factory method.
46
+	 *
47
+	 * Often you want to return an instance of the current class, but you are
48
+	 * free to return other data as well.
49
+	 *
50
+	 * You are responsible for advancing the reader to the next element. Not
51
+	 * doing anything will result in a never-ending loop.
52
+	 *
53
+	 * If you just want to skip parsing for this element altogether, you can
54
+	 * just call $reader->next();
55
+	 *
56
+	 * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
57
+	 * the next element.
58
+	 *
59
+	 * @return mixed
60
+	 */
61
+	public static function xmlDeserialize(Reader $reader)
62
+	{
63
+		$elems = $reader->parseInnerTree([
64
+			'{DAV:}sharee' => 'Sabre\DAV\Xml\Element\Sharee',
65
+			'{DAV:}share-access' => 'Sabre\DAV\Xml\Property\ShareAccess',
66
+			'{DAV:}prop' => 'Sabre\Xml\Deserializer\keyValue',
67
+		]);
68 68
 
69
-        $sharees = [];
69
+		$sharees = [];
70 70
 
71
-        foreach ($elems as $elem) {
72
-            if ('{DAV:}sharee' !== $elem['name']) {
73
-                continue;
74
-            }
75
-            $sharees[] = $elem['value'];
76
-        }
71
+		foreach ($elems as $elem) {
72
+			if ('{DAV:}sharee' !== $elem['name']) {
73
+				continue;
74
+			}
75
+			$sharees[] = $elem['value'];
76
+		}
77 77
 
78
-        return new self($sharees);
79
-    }
78
+		return new self($sharees);
79
+	}
80 80
 }
Please login to merge, or discard this patch.
includes/sabre/sabre/dav/lib/DAV/Xml/Request/SyncCollectionReport.php 1 patch
Indentation   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -22,97 +22,97 @@
 block discarded – undo
22 22
  */
23 23
 class SyncCollectionReport implements XmlDeserializable
24 24
 {
25
-    /**
26
-     * The sync-token the client supplied for the report.
27
-     *
28
-     * @var string|null
29
-     */
30
-    public $syncToken;
31
-
32
-    /**
33
-     * The 'depth' of the sync the client is interested in.
34
-     *
35
-     * @var int
36
-     */
37
-    public $syncLevel;
38
-
39
-    /**
40
-     * Maximum amount of items returned.
41
-     *
42
-     * @var int|null
43
-     */
44
-    public $limit;
45
-
46
-    /**
47
-     * The list of properties that are being requested for every change.
48
-     *
49
-     * @var array|null
50
-     */
51
-    public $properties;
52
-
53
-    /**
54
-     * The deserialize method is called during xml parsing.
55
-     *
56
-     * This method is called statically, this is because in theory this method
57
-     * may be used as a type of constructor, or factory method.
58
-     *
59
-     * Often you want to return an instance of the current class, but you are
60
-     * free to return other data as well.
61
-     *
62
-     * You are responsible for advancing the reader to the next element. Not
63
-     * doing anything will result in a never-ending loop.
64
-     *
65
-     * If you just want to skip parsing for this element altogether, you can
66
-     * just call $reader->next();
67
-     *
68
-     * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
69
-     * the next element.
70
-     *
71
-     * @return mixed
72
-     */
73
-    public static function xmlDeserialize(Reader $reader)
74
-    {
75
-        $self = new self();
76
-
77
-        $reader->pushContext();
78
-
79
-        $reader->elementMap['{DAV:}prop'] = 'Sabre\Xml\Element\Elements';
80
-        $elems = KeyValue::xmlDeserialize($reader);
81
-
82
-        $reader->popContext();
83
-
84
-        $required = [
85
-            '{DAV:}sync-token',
86
-            '{DAV:}prop',
87
-            ];
88
-
89
-        foreach ($required as $elem) {
90
-            if (!array_key_exists($elem, $elems)) {
91
-                throw new BadRequest('The '.$elem.' element in the {DAV:}sync-collection report is required');
92
-            }
93
-        }
94
-
95
-        $self->properties = $elems['{DAV:}prop'];
96
-        $self->syncToken = $elems['{DAV:}sync-token'];
97
-
98
-        if (isset($elems['{DAV:}limit'])) {
99
-            $nresults = null;
100
-            foreach ($elems['{DAV:}limit'] as $child) {
101
-                if ('{DAV:}nresults' === $child['name']) {
102
-                    $nresults = (int) $child['value'];
103
-                }
104
-            }
105
-            $self->limit = $nresults;
106
-        }
107
-
108
-        if (isset($elems['{DAV:}sync-level'])) {
109
-            $value = $elems['{DAV:}sync-level'];
110
-            if ('infinity' === $value) {
111
-                $value = \Sabre\DAV\Server::DEPTH_INFINITY;
112
-            }
113
-            $self->syncLevel = $value;
114
-        }
115
-
116
-        return $self;
117
-    }
25
+	/**
26
+	 * The sync-token the client supplied for the report.
27
+	 *
28
+	 * @var string|null
29
+	 */
30
+	public $syncToken;
31
+
32
+	/**
33
+	 * The 'depth' of the sync the client is interested in.
34
+	 *
35
+	 * @var int
36
+	 */
37
+	public $syncLevel;
38
+
39
+	/**
40
+	 * Maximum amount of items returned.
41
+	 *
42
+	 * @var int|null
43
+	 */
44
+	public $limit;
45
+
46
+	/**
47
+	 * The list of properties that are being requested for every change.
48
+	 *
49
+	 * @var array|null
50
+	 */
51
+	public $properties;
52
+
53
+	/**
54
+	 * The deserialize method is called during xml parsing.
55
+	 *
56
+	 * This method is called statically, this is because in theory this method
57
+	 * may be used as a type of constructor, or factory method.
58
+	 *
59
+	 * Often you want to return an instance of the current class, but you are
60
+	 * free to return other data as well.
61
+	 *
62
+	 * You are responsible for advancing the reader to the next element. Not
63
+	 * doing anything will result in a never-ending loop.
64
+	 *
65
+	 * If you just want to skip parsing for this element altogether, you can
66
+	 * just call $reader->next();
67
+	 *
68
+	 * $reader->parseInnerTree() will parse the entire sub-tree, and advance to
69
+	 * the next element.
70
+	 *
71
+	 * @return mixed
72
+	 */
73
+	public static function xmlDeserialize(Reader $reader)
74
+	{
75
+		$self = new self();
76
+
77
+		$reader->pushContext();
78
+
79
+		$reader->elementMap['{DAV:}prop'] = 'Sabre\Xml\Element\Elements';
80
+		$elems = KeyValue::xmlDeserialize($reader);
81
+
82
+		$reader->popContext();
83
+
84
+		$required = [
85
+			'{DAV:}sync-token',
86
+			'{DAV:}prop',
87
+			];
88
+
89
+		foreach ($required as $elem) {
90
+			if (!array_key_exists($elem, $elems)) {
91
+				throw new BadRequest('The '.$elem.' element in the {DAV:}sync-collection report is required');
92
+			}
93
+		}
94
+
95
+		$self->properties = $elems['{DAV:}prop'];
96
+		$self->syncToken = $elems['{DAV:}sync-token'];
97
+
98
+		if (isset($elems['{DAV:}limit'])) {
99
+			$nresults = null;
100
+			foreach ($elems['{DAV:}limit'] as $child) {
101
+				if ('{DAV:}nresults' === $child['name']) {
102
+					$nresults = (int) $child['value'];
103
+				}
104
+			}
105
+			$self->limit = $nresults;
106
+		}
107
+
108
+		if (isset($elems['{DAV:}sync-level'])) {
109
+			$value = $elems['{DAV:}sync-level'];
110
+			if ('infinity' === $value) {
111
+				$value = \Sabre\DAV\Server::DEPTH_INFINITY;
112
+			}
113
+			$self->syncLevel = $value;
114
+		}
115
+
116
+		return $self;
117
+	}
118 118
 }
Please login to merge, or discard this patch.