From 580c3f4ffe9608d2beb56d418c68b3b112420e76 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 10 Nov 2019 12:49:51 +0000 Subject: another bulk of composer updates (cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce) --- .../Xml/Property/CurrentUserPrivilegeSet.php | 54 ++++++++++------------ 1 file changed, 24 insertions(+), 30 deletions(-) (limited to 'vendor/sabre/dav/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php') diff --git a/vendor/sabre/dav/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php b/vendor/sabre/dav/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php index 74c09cee1..083856330 100644 --- a/vendor/sabre/dav/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php +++ b/vendor/sabre/dav/lib/DAVACL/Xml/Property/CurrentUserPrivilegeSet.php @@ -1,5 +1,7 @@ privileges = $privileges; - } /** @@ -57,19 +58,14 @@ class CurrentUserPrivilegeSet implements Element, HtmlOutput { * If you are opening new elements, you must also close them again. * * @param Writer $writer - * @return void */ - function xmlSerialize(Writer $writer) { - + public function xmlSerialize(Writer $writer) + { foreach ($this->privileges as $privName) { - $writer->startElement('{DAV:}privilege'); $writer->writeElement($privName); $writer->endElement(); - } - - } /** @@ -77,12 +73,12 @@ class CurrentUserPrivilegeSet implements Element, HtmlOutput { * list. * * @param string $privilegeName + * * @return bool */ - function has($privilegeName) { - + public function has($privilegeName) + { return in_array($privilegeName, $this->privileges); - } /** @@ -90,10 +86,9 @@ class CurrentUserPrivilegeSet implements Element, HtmlOutput { * * @return array */ - function getValue() { - + public function getValue() + { return $this->privileges; - } /** @@ -115,21 +110,22 @@ class CurrentUserPrivilegeSet implements Element, HtmlOutput { * the next element. * * @param Reader $reader + * * @return mixed */ - static function xmlDeserialize(Reader $reader) { - + public static function xmlDeserialize(Reader $reader) + { $result = []; $tree = $reader->parseInnerTree(['{DAV:}privilege' => 'Sabre\\Xml\\Element\\Elements']); foreach ($tree as $element) { - if ($element['name'] !== '{DAV:}privilege') { + if ('{DAV:}privilege' !== $element['name']) { continue; } $result[] = $element['value'][0]; } - return new self($result); + return new self($result); } /** @@ -144,16 +140,14 @@ class CurrentUserPrivilegeSet implements Element, HtmlOutput { * be used to construct local links. * * @param HtmlOutputHelper $html + * * @return string */ - function toHtml(HtmlOutputHelper $html) { - + public function toHtml(HtmlOutputHelper $html) + { return implode( ', ', array_map([$html, 'xmlName'], $this->getValue()) ); - } - - } -- cgit v1.2.3