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) --- vendor/sabre/dav/lib/CalDAV/CalendarObject.php | 104 +++++++++++-------------- 1 file changed, 47 insertions(+), 57 deletions(-) (limited to 'vendor/sabre/dav/lib/CalDAV/CalendarObject.php') diff --git a/vendor/sabre/dav/lib/CalDAV/CalendarObject.php b/vendor/sabre/dav/lib/CalDAV/CalendarObject.php index 9d6532a35..3f28ee7f7 100644 --- a/vendor/sabre/dav/lib/CalDAV/CalendarObject.php +++ b/vendor/sabre/dav/lib/CalDAV/CalendarObject.php @@ -1,5 +1,7 @@ caldavBackend = $caldavBackend; if (!isset($objectData['uri'])) { @@ -62,44 +64,43 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\ $this->calendarInfo = $calendarInfo; $this->objectData = $objectData; - } /** - * Returns the uri for this object + * Returns the uri for this object. * * @return string */ - function getName() { - + public function getName() + { return $this->objectData['uri']; - } /** - * Returns the ICalendar-formatted object + * Returns the ICalendar-formatted object. * * @return string */ - function get() { - + public function get() + { // Pre-populating the 'calendardata' is optional, if we don't have it // already we fetch it from the backend. if (!isset($this->objectData['calendardata'])) { $this->objectData = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $this->objectData['uri']); } - return $this->objectData['calendardata']; + return $this->objectData['calendardata']; } /** - * Updates the ICalendar-formatted object + * Updates the ICalendar-formatted object. * * @param string|resource $calendarData + * * @return string */ - function put($calendarData) { - + public function put($calendarData) + { if (is_resource($calendarData)) { $calendarData = stream_get_contents($calendarData); } @@ -108,33 +109,29 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\ $this->objectData['etag'] = $etag; return $etag; - } /** - * Deletes the calendar object - * - * @return void + * Deletes the calendar object. */ - function delete() { - + public function delete() + { $this->caldavBackend->deleteCalendarObject($this->calendarInfo['id'], $this->objectData['uri']); - } /** - * Returns the mime content-type + * Returns the mime content-type. * * @return string */ - function getContentType() { - + public function getContentType() + { $mime = 'text/calendar; charset=utf-8'; if (isset($this->objectData['component']) && $this->objectData['component']) { - $mime .= '; component=' . $this->objectData['component']; + $mime .= '; component='.$this->objectData['component']; } - return $mime; + return $mime; } /** @@ -144,53 +141,49 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\ * * @return string */ - function getETag() { - + public function getETag() + { if (isset($this->objectData['etag'])) { return $this->objectData['etag']; } else { - return '"' . md5($this->get()) . '"'; + return '"'.md5($this->get()).'"'; } - } /** - * Returns the last modification date as a unix timestamp + * Returns the last modification date as a unix timestamp. * * @return int */ - function getLastModified() { - + public function getLastModified() + { return $this->objectData['lastmodified']; - } /** - * Returns the size of this object in bytes + * Returns the size of this object in bytes. * * @return int */ - function getSize() { - + public function getSize() + { if (array_key_exists('size', $this->objectData)) { return $this->objectData['size']; } else { return strlen($this->get()); } - } /** - * Returns the owner principal + * Returns the owner principal. * * This must be a url to a principal, or null if there's no owner * * @return string|null */ - function getOwner() { - + public function getOwner() + { return $this->calendarInfo['principaluri']; - } /** @@ -205,8 +198,8 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\ * * @return array */ - function getACL() { - + public function getACL() + { // An alternative acl may be specified in the object data. if (isset($this->objectData['acl'])) { return $this->objectData['acl']; @@ -221,17 +214,14 @@ class CalendarObject extends \Sabre\DAV\File implements ICalendarObject, \Sabre\ ], [ 'privilege' => '{DAV:}all', - 'principal' => $this->calendarInfo['principaluri'] . '/calendar-proxy-write', + 'principal' => $this->calendarInfo['principaluri'].'/calendar-proxy-write', 'protected' => true, ], [ 'privilege' => '{DAV:}read', - 'principal' => $this->calendarInfo['principaluri'] . '/calendar-proxy-read', + 'principal' => $this->calendarInfo['principaluri'].'/calendar-proxy-read', 'protected' => true, ], - ]; - } - } -- cgit v1.2.3