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) --- .../dav/lib/CalDAV/Subscriptions/Subscription.php | 86 ++++++++++------------ 1 file changed, 37 insertions(+), 49 deletions(-) (limited to 'vendor/sabre/dav/lib/CalDAV/Subscriptions/Subscription.php') diff --git a/vendor/sabre/dav/lib/CalDAV/Subscriptions/Subscription.php b/vendor/sabre/dav/lib/CalDAV/Subscriptions/Subscription.php index 6a1851ed8..0b0282abe 100644 --- a/vendor/sabre/dav/lib/CalDAV/Subscriptions/Subscription.php +++ b/vendor/sabre/dav/lib/CalDAV/Subscriptions/Subscription.php @@ -1,5 +1,7 @@ caldavBackend = $caldavBackend; $this->subscriptionInfo = $subscriptionInfo; @@ -56,10 +58,9 @@ class Subscription extends Collection implements ISubscription, IACL { foreach ($required as $r) { if (!isset($subscriptionInfo[$r])) { - throw new \InvalidArgumentException('The ' . $r . ' field is required when creating a subscription node'); + throw new \InvalidArgumentException('The '.$r.' field is required when creating a subscription node'); } } - } /** @@ -69,47 +70,41 @@ class Subscription extends Collection implements ISubscription, IACL { * * @return string */ - function getName() { - + public function getName() + { return $this->subscriptionInfo['uri']; - } /** - * Returns the last modification time + * Returns the last modification time. * * @return int */ - function getLastModified() { - + public function getLastModified() + { if (isset($this->subscriptionInfo['lastmodified'])) { return $this->subscriptionInfo['lastmodified']; } - } /** - * Deletes the current node - * - * @return void + * Deletes the current node. */ - function delete() { - + public function delete() + { $this->caldavBackend->deleteSubscription( $this->subscriptionInfo['id'] ); - } /** - * Returns an array with all the child nodes + * Returns an array with all the child nodes. * * @return \Sabre\DAV\INode[] */ - function getChildren() { - + public function getChildren() + { return []; - } /** @@ -122,15 +117,13 @@ class Subscription extends Collection implements ISubscription, IACL { * Read the PropPatch documentation for more information. * * @param PropPatch $propPatch - * @return void */ - function propPatch(PropPatch $propPatch) { - + public function propPatch(PropPatch $propPatch) + { return $this->caldavBackend->updateSubscription( $this->subscriptionInfo['id'], $propPatch ); - } /** @@ -146,29 +139,27 @@ class Subscription extends Collection implements ISubscription, IACL { * The Server class will filter out the extra. * * @param array $properties + * * @return array */ - function getProperties($properties) { - + public function getProperties($properties) + { $r = []; foreach ($properties as $prop) { - switch ($prop) { - case '{http://calendarserver.org/ns/}source' : + case '{http://calendarserver.org/ns/}source': $r[$prop] = new Href($this->subscriptionInfo['source']); break; - default : + default: if (array_key_exists($prop, $this->subscriptionInfo)) { $r[$prop] = $this->subscriptionInfo[$prop]; } break; } - } return $r; - } /** @@ -178,10 +169,9 @@ class Subscription extends Collection implements ISubscription, IACL { * * @return string|null */ - function getOwner() { - + public function getOwner() + { return $this->subscriptionInfo['principaluri']; - } /** @@ -196,8 +186,8 @@ class Subscription extends Collection implements ISubscription, IACL { * * @return array */ - function getACL() { - + public function getACL() + { return [ [ 'privilege' => '{DAV:}all', @@ -206,16 +196,14 @@ class Subscription extends Collection implements ISubscription, IACL { ], [ 'privilege' => '{DAV:}all', - 'principal' => $this->getOwner() . '/calendar-proxy-write', + 'principal' => $this->getOwner().'/calendar-proxy-write', 'protected' => true, ], [ 'privilege' => '{DAV:}read', - 'principal' => $this->getOwner() . '/calendar-proxy-read', + 'principal' => $this->getOwner().'/calendar-proxy-read', 'protected' => true, - ] + ], ]; - } - } -- cgit v1.2.3