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/Xml/Filter/CalendarData.php | 23 +++-- .../sabre/dav/lib/CalDAV/Xml/Filter/CompFilter.php | 43 ++++---- .../dav/lib/CalDAV/Xml/Filter/ParamFilter.php | 37 ++++--- .../sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php | 47 +++++---- .../dav/lib/CalDAV/Xml/Notification/Invite.php | 108 ++++++++++----------- .../lib/CalDAV/Xml/Notification/InviteReply.php | 80 +++++++-------- .../Xml/Notification/NotificationInterface.php | 16 +-- .../lib/CalDAV/Xml/Notification/SystemStatus.php | 69 ++++++------- .../CalDAV/Xml/Property/AllowedSharingModes.php | 32 +++--- .../lib/CalDAV/Xml/Property/EmailAddressSet.php | 33 +++---- .../sabre/dav/lib/CalDAV/Xml/Property/Invite.php | 68 ++++++------- .../CalDAV/Xml/Property/ScheduleCalendarTransp.php | 46 +++++---- .../Xml/Property/SupportedCalendarComponentSet.php | 39 ++++---- .../CalDAV/Xml/Property/SupportedCalendarData.php | 21 ++-- .../CalDAV/Xml/Property/SupportedCollationSet.php | 19 ++-- .../CalDAV/Xml/Request/CalendarMultiGetReport.php | 29 +++--- .../lib/CalDAV/Xml/Request/CalendarQueryReport.php | 44 ++++----- .../lib/CalDAV/Xml/Request/FreeBusyQueryReport.php | 33 ++++--- .../dav/lib/CalDAV/Xml/Request/InviteReply.php | 45 ++++----- .../dav/lib/CalDAV/Xml/Request/MkCalendar.php | 20 ++-- vendor/sabre/dav/lib/CalDAV/Xml/Request/Share.php | 48 +++++---- 21 files changed, 421 insertions(+), 479 deletions(-) (limited to 'vendor/sabre/dav/lib/CalDAV/Xml') diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Filter/CalendarData.php b/vendor/sabre/dav/lib/CalDAV/Xml/Filter/CalendarData.php index 9669be304..0d53aeda3 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Filter/CalendarData.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Filter/CalendarData.php @@ -1,5 +1,7 @@ $reader->getAttribute('content-type') ?: 'text/calendar', - 'version' => $reader->getAttribute('version') ?: '2.0', + 'version' => $reader->getAttribute('version') ?: '2.0', ]; - $elems = (array)$reader->parseInnerTree(); + $elems = (array) $reader->parseInnerTree(); foreach ($elems as $elem) { - switch ($elem['name']) { - case '{' . Plugin::NS_CALDAV . '}expand' : + case '{'.Plugin::NS_CALDAV.'}expand': $result['expand'] = [ 'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, - 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, + 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, ]; if (!$result['expand']['start'] || !$result['expand']['end']) { @@ -74,11 +76,8 @@ class CalendarData implements XmlDeserializable { } break; } - } return $result; - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Filter/CompFilter.php b/vendor/sabre/dav/lib/CalDAV/Xml/Filter/CompFilter.php index c21ede66b..832346eea 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Filter/CompFilter.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Filter/CompFilter.php @@ -1,5 +1,7 @@ null, + 'name' => null, 'is-not-defined' => false, - 'comp-filters' => [], - 'prop-filters' => [], - 'time-range' => false, + 'comp-filters' => [], + 'prop-filters' => [], + 'time-range' => false, ]; $att = $reader->parseAttributes(); @@ -60,38 +63,34 @@ class CompFilter implements XmlDeserializable { $elems = $reader->parseInnerTree(); - if (is_array($elems)) foreach ($elems as $elem) { - - switch ($elem['name']) { - - case '{' . Plugin::NS_CALDAV . '}comp-filter' : + if (is_array($elems)) { + foreach ($elems as $elem) { + switch ($elem['name']) { + case '{'.Plugin::NS_CALDAV.'}comp-filter': $result['comp-filters'][] = $elem['value']; break; - case '{' . Plugin::NS_CALDAV . '}prop-filter' : + case '{'.Plugin::NS_CALDAV.'}prop-filter': $result['prop-filters'][] = $elem['value']; break; - case '{' . Plugin::NS_CALDAV . '}is-not-defined' : + case '{'.Plugin::NS_CALDAV.'}is-not-defined': $result['is-not-defined'] = true; break; - case '{' . Plugin::NS_CALDAV . '}time-range' : - if ($result['name'] === 'VCALENDAR') { + case '{'.Plugin::NS_CALDAV.'}time-range': + if ('VCALENDAR' === $result['name']) { throw new BadRequest('You cannot add time-range filters on the VCALENDAR component'); } $result['time-range'] = [ 'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, - 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, + 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, ]; if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { throw new BadRequest('The end-date must be larger than the start-date'); } break; - } - + } } return $result; - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Filter/ParamFilter.php b/vendor/sabre/dav/lib/CalDAV/Xml/Filter/ParamFilter.php index bf422cf05..ec9ff753c 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Filter/ParamFilter.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Filter/ParamFilter.php @@ -1,5 +1,7 @@ null, + 'name' => null, 'is-not-defined' => false, - 'text-match' => null, + 'text-match' => null, ]; $att = $reader->parseAttributes(); @@ -56,27 +59,23 @@ class ParamFilter implements XmlDeserializable { $elems = $reader->parseInnerTree(); - if (is_array($elems)) foreach ($elems as $elem) { - - switch ($elem['name']) { - - case '{' . Plugin::NS_CALDAV . '}is-not-defined' : + if (is_array($elems)) { + foreach ($elems as $elem) { + switch ($elem['name']) { + case '{'.Plugin::NS_CALDAV.'}is-not-defined': $result['is-not-defined'] = true; break; - case '{' . Plugin::NS_CALDAV . '}text-match' : + case '{'.Plugin::NS_CALDAV.'}text-match': $result['text-match'] = [ - 'negate-condition' => isset($elem['attributes']['negate-condition']) && $elem['attributes']['negate-condition'] === 'yes', - 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', - 'value' => $elem['value'], + 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], + 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', + 'value' => $elem['value'], ]; break; - } - + } } return $result; - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php b/vendor/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php index db9207295..f4600574e 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Filter/PropFilter.php @@ -1,5 +1,7 @@ null, + 'name' => null, 'is-not-defined' => false, - 'param-filters' => [], - 'text-match' => null, - 'time-range' => false, + 'param-filters' => [], + 'text-match' => null, + 'time-range' => false, ]; $att = $reader->parseAttributes(); @@ -60,39 +63,35 @@ class PropFilter implements XmlDeserializable { $elems = $reader->parseInnerTree(); - if (is_array($elems)) foreach ($elems as $elem) { - - switch ($elem['name']) { - - case '{' . Plugin::NS_CALDAV . '}param-filter' : + if (is_array($elems)) { + foreach ($elems as $elem) { + switch ($elem['name']) { + case '{'.Plugin::NS_CALDAV.'}param-filter': $result['param-filters'][] = $elem['value']; break; - case '{' . Plugin::NS_CALDAV . '}is-not-defined' : + case '{'.Plugin::NS_CALDAV.'}is-not-defined': $result['is-not-defined'] = true; break; - case '{' . Plugin::NS_CALDAV . '}time-range' : + case '{'.Plugin::NS_CALDAV.'}time-range': $result['time-range'] = [ 'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, - 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, + 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, ]; if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { throw new BadRequest('The end-date must be larger than the start-date'); } break; - case '{' . Plugin::NS_CALDAV . '}text-match' : + case '{'.Plugin::NS_CALDAV.'}text-match': $result['text-match'] = [ - 'negate-condition' => isset($elem['attributes']['negate-condition']) && $elem['attributes']['negate-condition'] === 'yes', - 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', - 'value' => $elem['value'], + 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], + 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', + 'value' => $elem['value'], ]; break; - } - + } } return $result; - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Notification/Invite.php b/vendor/sabre/dav/lib/CalDAV/Xml/Notification/Invite.php index 92a9ac7b7..926656674 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Notification/Invite.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Notification/Invite.php @@ -1,5 +1,7 @@ $value) { if (!property_exists($this, $key)) { - throw new \InvalidArgumentException('Unknown option: ' . $key); + throw new \InvalidArgumentException('Unknown option: '.$key); } $this->$key = $value; } - } /** @@ -182,12 +183,10 @@ class Invite implements NotificationInterface { * If you are opening new elements, you must also close them again. * * @param Writer $writer - * @return void */ - function xmlSerialize(Writer $writer) { - - $writer->writeElement('{' . CalDAV\Plugin::NS_CALENDARSERVER . '}invite-notification'); - + public function xmlSerialize(Writer $writer) + { + $writer->writeElement('{'.CalDAV\Plugin::NS_CALENDARSERVER.'}invite-notification'); } /** @@ -195,95 +194,90 @@ class Invite implements NotificationInterface { * response body. * * @param Writer $writer - * @return void */ - function xmlSerializeFull(Writer $writer) { + public function xmlSerializeFull(Writer $writer) + { + $cs = '{'.CalDAV\Plugin::NS_CALENDARSERVER.'}'; - $cs = '{' . CalDAV\Plugin::NS_CALENDARSERVER . '}'; + $this->dtStamp->setTimezone(new \DateTimeZone('GMT')); + $writer->writeElement($cs.'dtstamp', $this->dtStamp->format('Ymd\\THis\\Z')); - $this->dtStamp->setTimezone(new \DateTimezone('GMT')); - $writer->writeElement($cs . 'dtstamp', $this->dtStamp->format('Ymd\\THis\\Z')); + $writer->startElement($cs.'invite-notification'); - $writer->startElement($cs . 'invite-notification'); - - $writer->writeElement($cs . 'uid', $this->id); + $writer->writeElement($cs.'uid', $this->id); $writer->writeElement('{DAV:}href', $this->href); switch ($this->type) { - - case DAV\Sharing\Plugin::INVITE_ACCEPTED : - $writer->writeElement($cs . 'invite-accepted'); + case DAV\Sharing\Plugin::INVITE_ACCEPTED: + $writer->writeElement($cs.'invite-accepted'); break; - case DAV\Sharing\Plugin::INVITE_NORESPONSE : - $writer->writeElement($cs . 'invite-noresponse'); + case DAV\Sharing\Plugin::INVITE_NORESPONSE: + $writer->writeElement($cs.'invite-noresponse'); break; - } - $writer->writeElement($cs . 'hosturl', [ - '{DAV:}href' => $writer->contextUri . $this->hostUrl + $writer->writeElement($cs.'hosturl', [ + '{DAV:}href' => $writer->contextUri.$this->hostUrl, ]); if ($this->summary) { - $writer->writeElement($cs . 'summary', $this->summary); + $writer->writeElement($cs.'summary', $this->summary); } - $writer->startElement($cs . 'access'); + $writer->startElement($cs.'access'); if ($this->readOnly) { - $writer->writeElement($cs . 'read'); + $writer->writeElement($cs.'read'); } else { - $writer->writeElement($cs . 'read-write'); + $writer->writeElement($cs.'read-write'); } $writer->endElement(); // access - $writer->startElement($cs . 'organizer'); + $writer->startElement($cs.'organizer'); // If the organizer contains a 'mailto:' part, it means it should be // treated as absolute. - if (strtolower(substr($this->organizer, 0, 7)) === 'mailto:') { + if ('mailto:' === strtolower(substr($this->organizer, 0, 7))) { $writer->writeElement('{DAV:}href', $this->organizer); } else { - $writer->writeElement('{DAV:}href', $writer->contextUri . $this->organizer); + $writer->writeElement('{DAV:}href', $writer->contextUri.$this->organizer); } if ($this->commonName) { - $writer->writeElement($cs . 'common-name', $this->commonName); + $writer->writeElement($cs.'common-name', $this->commonName); } if ($this->firstName) { - $writer->writeElement($cs . 'first-name', $this->firstName); + $writer->writeElement($cs.'first-name', $this->firstName); } if ($this->lastName) { - $writer->writeElement($cs . 'last-name', $this->lastName); + $writer->writeElement($cs.'last-name', $this->lastName); } $writer->endElement(); // organizer if ($this->commonName) { - $writer->writeElement($cs . 'organizer-cn', $this->commonName); + $writer->writeElement($cs.'organizer-cn', $this->commonName); } if ($this->firstName) { - $writer->writeElement($cs . 'organizer-first', $this->firstName); + $writer->writeElement($cs.'organizer-first', $this->firstName); } if ($this->lastName) { - $writer->writeElement($cs . 'organizer-last', $this->lastName); + $writer->writeElement($cs.'organizer-last', $this->lastName); } if ($this->supportedComponents) { - $writer->writeElement('{' . CalDAV\Plugin::NS_CALDAV . '}supported-calendar-component-set', $this->supportedComponents); + $writer->writeElement('{'.CalDAV\Plugin::NS_CALDAV.'}supported-calendar-component-set', $this->supportedComponents); } $writer->endElement(); // invite-notification - } /** - * Returns a unique id for this notification + * Returns a unique id for this notification. * * This is just the base url. This should generally be some kind of unique * id. * * @return string */ - function getId() { - + public function getId() + { return $this->id; - } /** @@ -293,10 +287,8 @@ class Invite implements NotificationInterface { * * @return string */ - function getETag() { - + public function getETag() + { return $this->etag; - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Notification/InviteReply.php b/vendor/sabre/dav/lib/CalDAV/Xml/Notification/InviteReply.php index f4b10a396..abcbde151 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Notification/InviteReply.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Notification/InviteReply.php @@ -1,5 +1,7 @@ $value) { if (!property_exists($this, $key)) { - throw new \InvalidArgumentException('Unknown option: ' . $key); + throw new \InvalidArgumentException('Unknown option: '.$key); } $this->$key = $value; } - } /** @@ -133,12 +134,10 @@ class InviteReply implements NotificationInterface { * If you are opening new elements, you must also close them again. * * @param Writer $writer - * @return void */ - function xmlSerialize(Writer $writer) { - - $writer->writeElement('{' . CalDAV\Plugin::NS_CALENDARSERVER . '}invite-reply'); - + public function xmlSerialize(Writer $writer) + { + $writer->writeElement('{'.CalDAV\Plugin::NS_CALENDARSERVER.'}invite-reply'); } /** @@ -146,55 +145,50 @@ class InviteReply implements NotificationInterface { * response body. * * @param Writer $writer - * @return void */ - function xmlSerializeFull(Writer $writer) { + public function xmlSerializeFull(Writer $writer) + { + $cs = '{'.CalDAV\Plugin::NS_CALENDARSERVER.'}'; - $cs = '{' . CalDAV\Plugin::NS_CALENDARSERVER . '}'; + $this->dtStamp->setTimezone(new \DateTimeZone('GMT')); + $writer->writeElement($cs.'dtstamp', $this->dtStamp->format('Ymd\\THis\\Z')); - $this->dtStamp->setTimezone(new \DateTimezone('GMT')); - $writer->writeElement($cs . 'dtstamp', $this->dtStamp->format('Ymd\\THis\\Z')); + $writer->startElement($cs.'invite-reply'); - $writer->startElement($cs . 'invite-reply'); - - $writer->writeElement($cs . 'uid', $this->id); - $writer->writeElement($cs . 'in-reply-to', $this->inReplyTo); + $writer->writeElement($cs.'uid', $this->id); + $writer->writeElement($cs.'in-reply-to', $this->inReplyTo); $writer->writeElement('{DAV:}href', $this->href); switch ($this->type) { - - case DAV\Sharing\Plugin::INVITE_ACCEPTED : - $writer->writeElement($cs . 'invite-accepted'); + case DAV\Sharing\Plugin::INVITE_ACCEPTED: + $writer->writeElement($cs.'invite-accepted'); break; - case DAV\Sharing\Plugin::INVITE_DECLINED : - $writer->writeElement($cs . 'invite-declined'); + case DAV\Sharing\Plugin::INVITE_DECLINED: + $writer->writeElement($cs.'invite-declined'); break; - } - $writer->writeElement($cs . 'hosturl', [ - '{DAV:}href' => $writer->contextUri . $this->hostUrl + $writer->writeElement($cs.'hosturl', [ + '{DAV:}href' => $writer->contextUri.$this->hostUrl, ]); if ($this->summary) { - $writer->writeElement($cs . 'summary', $this->summary); + $writer->writeElement($cs.'summary', $this->summary); } $writer->endElement(); // invite-reply - } /** - * Returns a unique id for this notification + * Returns a unique id for this notification. * * This is just the base url. This should generally be some kind of unique * id. * * @return string */ - function getId() { - + public function getId() + { return $this->id; - } /** @@ -204,10 +198,8 @@ class InviteReply implements NotificationInterface { * * @return string */ - function getETag() { - + public function getETag() + { return $this->etag; - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Notification/NotificationInterface.php b/vendor/sabre/dav/lib/CalDAV/Xml/Notification/NotificationInterface.php index b98f9c888..be7490533 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Notification/NotificationInterface.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Notification/NotificationInterface.php @@ -1,5 +1,7 @@ id = $id; $this->type = $type; $this->description = $description; $this->href = $href; $this->etag = $etag; - } /** @@ -91,27 +92,25 @@ class SystemStatus implements NotificationInterface { * responsible for closing them. * * @param Writer $writer - * @return void */ - function xmlSerialize(Writer $writer) { - + public function xmlSerialize(Writer $writer) + { switch ($this->type) { - case self::TYPE_LOW : + case self::TYPE_LOW: $type = 'low'; break; - case self::TYPE_MEDIUM : + case self::TYPE_MEDIUM: $type = 'medium'; break; - default : - case self::TYPE_HIGH : + default: + case self::TYPE_HIGH: $type = 'high'; break; } - $writer->startElement('{' . Plugin::NS_CALENDARSERVER . '}systemstatus'); + $writer->startElement('{'.Plugin::NS_CALENDARSERVER.'}systemstatus'); $writer->writeAttribute('type', $type); $writer->endElement(); - } /** @@ -119,51 +118,47 @@ class SystemStatus implements NotificationInterface { * response body. * * @param Writer $writer - * @return void */ - function xmlSerializeFull(Writer $writer) { - - $cs = '{' . Plugin::NS_CALENDARSERVER . '}'; + public function xmlSerializeFull(Writer $writer) + { + $cs = '{'.Plugin::NS_CALENDARSERVER.'}'; switch ($this->type) { - case self::TYPE_LOW : + case self::TYPE_LOW: $type = 'low'; break; - case self::TYPE_MEDIUM : + case self::TYPE_MEDIUM: $type = 'medium'; break; - default : - case self::TYPE_HIGH : + default: + case self::TYPE_HIGH: $type = 'high'; break; } - $writer->startElement($cs . 'systemstatus'); + $writer->startElement($cs.'systemstatus'); $writer->writeAttribute('type', $type); - if ($this->description) { - $writer->writeElement($cs . 'description', $this->description); + $writer->writeElement($cs.'description', $this->description); } if ($this->href) { $writer->writeElement('{DAV:}href', $this->href); } $writer->endElement(); // systemstatus - } /** - * Returns a unique id for this notification + * Returns a unique id for this notification. * * This is just the base url. This should generally be some kind of unique * id. * * @return string */ - function getId() { - + public function getId() + { return $this->id; - } /* @@ -173,10 +168,8 @@ class SystemStatus implements NotificationInterface { * * @return string */ - function getETag() { - + public function getETag() + { return $this->etag; - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Property/AllowedSharingModes.php b/vendor/sabre/dav/lib/CalDAV/Xml/Property/AllowedSharingModes.php index 54e5a116a..224f52c96 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Property/AllowedSharingModes.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Property/AllowedSharingModes.php @@ -1,5 +1,7 @@ canBeShared = $canBeShared; $this->canBePublished = $canBePublished; - } /** @@ -69,19 +70,14 @@ class AllowedSharingModes implements XmlSerializable { * 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) + { if ($this->canBeShared) { - $writer->writeElement('{' . Plugin::NS_CALENDARSERVER . '}can-be-shared'); + $writer->writeElement('{'.Plugin::NS_CALENDARSERVER.'}can-be-shared'); } if ($this->canBePublished) { - $writer->writeElement('{' . Plugin::NS_CALENDARSERVER . '}can-be-published'); + $writer->writeElement('{'.Plugin::NS_CALENDARSERVER.'}can-be-published'); } - } - - - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Property/EmailAddressSet.php b/vendor/sabre/dav/lib/CalDAV/Xml/Property/EmailAddressSet.php index fc6f1d505..6b28d5df2 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Property/EmailAddressSet.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Property/EmailAddressSet.php @@ -1,12 +1,14 @@ emails = $emails; - } /** - * Returns the email addresses + * Returns the email addresses. * * @return array */ - function getValue() { - + public function getValue() + { return $this->emails; - } /** @@ -65,16 +65,11 @@ class EmailAddressSet implements XmlSerializable { * 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->emails as $email) { - $writer->writeElement('{http://calendarserver.org/ns/}email-address', $email); - } - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Property/Invite.php b/vendor/sabre/dav/lib/CalDAV/Xml/Property/Invite.php index 4f33c464c..db456617c 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Property/Invite.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Property/Invite.php @@ -1,5 +1,7 @@ sharees = $sharees; - } /** @@ -45,10 +47,9 @@ class Invite implements XmlSerializable { * * @return array */ - function getValue() { - + public function getValue() + { return $this->sharees; - } /** @@ -68,61 +69,54 @@ class Invite implements XmlSerializable { * If you are opening new elements, you must also close them again. * * @param Writer $writer - * @return void */ - function xmlSerialize(Writer $writer) { - - $cs = '{' . Plugin::NS_CALENDARSERVER . '}'; + public function xmlSerialize(Writer $writer) + { + $cs = '{'.Plugin::NS_CALENDARSERVER.'}'; foreach ($this->sharees as $sharee) { - - if ($sharee->access === DAV\Sharing\Plugin::ACCESS_SHAREDOWNER) { - $writer->startElement($cs . 'organizer'); + if (DAV\Sharing\Plugin::ACCESS_SHAREDOWNER === $sharee->access) { + $writer->startElement($cs.'organizer'); } else { - $writer->startElement($cs . 'user'); + $writer->startElement($cs.'user'); switch ($sharee->inviteStatus) { - case DAV\Sharing\Plugin::INVITE_ACCEPTED : - $writer->writeElement($cs . 'invite-accepted'); + case DAV\Sharing\Plugin::INVITE_ACCEPTED: + $writer->writeElement($cs.'invite-accepted'); break; - case DAV\Sharing\Plugin::INVITE_DECLINED : - $writer->writeElement($cs . 'invite-declined'); + case DAV\Sharing\Plugin::INVITE_DECLINED: + $writer->writeElement($cs.'invite-declined'); break; - case DAV\Sharing\Plugin::INVITE_NORESPONSE : - $writer->writeElement($cs . 'invite-noresponse'); + case DAV\Sharing\Plugin::INVITE_NORESPONSE: + $writer->writeElement($cs.'invite-noresponse'); break; - case DAV\Sharing\Plugin::INVITE_INVALID : - $writer->writeElement($cs . 'invite-invalid'); + case DAV\Sharing\Plugin::INVITE_INVALID: + $writer->writeElement($cs.'invite-invalid'); break; } - $writer->startElement($cs . 'access'); + $writer->startElement($cs.'access'); switch ($sharee->access) { - case DAV\Sharing\Plugin::ACCESS_READWRITE : - $writer->writeElement($cs . 'read-write'); + case DAV\Sharing\Plugin::ACCESS_READWRITE: + $writer->writeElement($cs.'read-write'); break; - case DAV\Sharing\Plugin::ACCESS_READ : - $writer->writeElement($cs . 'read'); + case DAV\Sharing\Plugin::ACCESS_READ: + $writer->writeElement($cs.'read'); break; - } $writer->endElement(); // access - } $href = new DAV\Xml\Property\Href($sharee->href); $href->xmlSerialize($writer); if (isset($sharee->properties['{DAV:}displayname'])) { - $writer->writeElement($cs . 'common-name', $sharee->properties['{DAV:}displayname']); + $writer->writeElement($cs.'common-name', $sharee->properties['{DAV:}displayname']); } if ($sharee->comment) { - $writer->writeElement($cs . 'summary', $sharee->comment); + $writer->writeElement($cs.'summary', $sharee->comment); } $writer->endElement(); // organizer or user - } - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Property/ScheduleCalendarTransp.php b/vendor/sabre/dav/lib/CalDAV/Xml/Property/ScheduleCalendarTransp.php index 10c20be55..780907169 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Property/ScheduleCalendarTransp.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Property/ScheduleCalendarTransp.php @@ -1,5 +1,7 @@ value = $value; - } /** - * Returns the current value + * Returns the current value. * * @return string */ - function getValue() { - + public function getValue() + { return $this->value; - } /** @@ -78,19 +78,17 @@ class ScheduleCalendarTransp implements Element { * 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) + { switch ($this->value) { - case self::TRANSPARENT : - $writer->writeElement('{' . Plugin::NS_CALDAV . '}transparent'); + case self::TRANSPARENT: + $writer->writeElement('{'.Plugin::NS_CALDAV.'}transparent'); break; - case self::OPAQUE : - $writer->writeElement('{' . Plugin::NS_CALDAV . '}opaque'); + case self::OPAQUE: + $writer->writeElement('{'.Plugin::NS_CALDAV.'}opaque'); break; } - } /** @@ -112,10 +110,11 @@ class ScheduleCalendarTransp implements Element { * the next element. * * @param Reader $reader + * * @return mixed */ - static function xmlDeserialize(Reader $reader) { - + public static function xmlDeserialize(Reader $reader) + { $elems = Deserializer\enum($reader, Plugin::NS_CALDAV); if (in_array('transparent', $elems)) { @@ -123,8 +122,7 @@ class ScheduleCalendarTransp implements Element { } else { $value = self::OPAQUE; } - return new self($value); + return new self($value); } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php b/vendor/sabre/dav/lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php index 7fc25c5f0..56fa61b13 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Property/SupportedCalendarComponentSet.php @@ -1,5 +1,7 @@ components = $components; - } /** - * Returns the list of supported components + * Returns the list of supported components. * * @return array */ - function getValue() { - + public function getValue() + { return $this->components; - } /** @@ -71,18 +71,14 @@ class SupportedCalendarComponentSet implements Element { * 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->components as $component) { - - $writer->startElement('{' . Plugin::NS_CALDAV . '}comp'); + $writer->startElement('{'.Plugin::NS_CALDAV.'}comp'); $writer->writeAttributes(['name' => $component]); $writer->endElement(); - } - } /** @@ -104,16 +100,17 @@ class SupportedCalendarComponentSet implements Element { * the next element. * * @param Reader $reader + * * @return mixed */ - static function xmlDeserialize(Reader $reader) { - + public static function xmlDeserialize(Reader $reader) + { $elems = $reader->parseInnerTree(); $components = []; - foreach ((array)$elems as $elem) { - if ($elem['name'] === '{' . Plugin::NS_CALDAV . '}comp') { + foreach ((array) $elems as $elem) { + if ($elem['name'] === '{'.Plugin::NS_CALDAV.'}comp') { $components[] = $elem['attributes']['name']; } } @@ -123,7 +120,5 @@ class SupportedCalendarComponentSet implements Element { } return new self($components); - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Property/SupportedCalendarData.php b/vendor/sabre/dav/lib/CalDAV/Xml/Property/SupportedCalendarData.php index d123ba4c0..1c9c4779f 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Property/SupportedCalendarData.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Property/SupportedCalendarData.php @@ -1,5 +1,7 @@ startElement('{' . Plugin::NS_CALDAV . '}calendar-data'); + public function xmlSerialize(Writer $writer) + { + $writer->startElement('{'.Plugin::NS_CALDAV.'}calendar-data'); $writer->writeAttributes([ 'content-type' => 'text/calendar', - 'version' => '2.0', + 'version' => '2.0', ]); $writer->endElement(); // calendar-data - $writer->startElement('{' . Plugin::NS_CALDAV . '}calendar-data'); + $writer->startElement('{'.Plugin::NS_CALDAV.'}calendar-data'); $writer->writeAttributes([ 'content-type' => 'application/calendar+json', ]); $writer->endElement(); // calendar-data - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Property/SupportedCollationSet.php b/vendor/sabre/dav/lib/CalDAV/Xml/Property/SupportedCollationSet.php index af10860d0..b88cd0d92 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Property/SupportedCollationSet.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Property/SupportedCollationSet.php @@ -1,5 +1,7 @@ writeElement('{' . Plugin::NS_CALDAV . '}supported-collation', $collation); + $writer->writeElement('{'.Plugin::NS_CALDAV.'}supported-collation', $collation); } - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Request/CalendarMultiGetReport.php b/vendor/sabre/dav/lib/CalDAV/Xml/Request/CalendarMultiGetReport.php index 6d3c5d508..8231de6bd 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Request/CalendarMultiGetReport.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Request/CalendarMultiGetReport.php @@ -1,5 +1,7 @@ parseInnerTree([ '{urn:ietf:params:xml:ns:caldav}calendar-data' => 'Sabre\\CalDAV\\Xml\\Filter\\CalendarData', - '{DAV:}prop' => 'Sabre\\Xml\\Element\\KeyValue', + '{DAV:}prop' => 'Sabre\\Xml\\Element\\KeyValue', ]); $newProps = [ - 'hrefs' => [], + 'hrefs' => [], 'properties' => [], ]; foreach ($elems as $elem) { - switch ($elem['name']) { - - case '{DAV:}prop' : + case '{DAV:}prop': $newProps['properties'] = array_keys($elem['value']); - if (isset($elem['value']['{' . Plugin::NS_CALDAV . '}calendar-data'])) { - $newProps += $elem['value']['{' . Plugin::NS_CALDAV . '}calendar-data']; + if (isset($elem['value']['{'.Plugin::NS_CALDAV.'}calendar-data'])) { + $newProps += $elem['value']['{'.Plugin::NS_CALDAV.'}calendar-data']; } break; - case '{DAV:}href' : + case '{DAV:}href': $newProps['hrefs'][] = Uri\resolve($reader->contextUri, $elem['value']); break; - } - } $obj = new self(); @@ -118,7 +117,5 @@ class CalendarMultiGetReport implements XmlDeserializable { } return $obj; - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Request/CalendarQueryReport.php b/vendor/sabre/dav/lib/CalDAV/Xml/Request/CalendarQueryReport.php index e0b1c7950..e85eccd2d 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Request/CalendarQueryReport.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Request/CalendarQueryReport.php @@ -1,5 +1,7 @@ parseInnerTree([ - '{urn:ietf:params:xml:ns:caldav}comp-filter' => 'Sabre\\CalDAV\\Xml\\Filter\\CompFilter', - '{urn:ietf:params:xml:ns:caldav}prop-filter' => 'Sabre\\CalDAV\\Xml\\Filter\\PropFilter', - '{urn:ietf:params:xml:ns:caldav}param-filter' => 'Sabre\\CalDAV\\Xml\\Filter\\ParamFilter', + '{urn:ietf:params:xml:ns:caldav}comp-filter' => 'Sabre\\CalDAV\\Xml\\Filter\\CompFilter', + '{urn:ietf:params:xml:ns:caldav}prop-filter' => 'Sabre\\CalDAV\\Xml\\Filter\\PropFilter', + '{urn:ietf:params:xml:ns:caldav}param-filter' => 'Sabre\\CalDAV\\Xml\\Filter\\ParamFilter', '{urn:ietf:params:xml:ns:caldav}calendar-data' => 'Sabre\\CalDAV\\Xml\\Filter\\CalendarData', - '{DAV:}prop' => 'Sabre\\Xml\\Element\\KeyValue', + '{DAV:}prop' => 'Sabre\\Xml\\Element\\KeyValue', ]); $newProps = [ - 'filters' => null, + 'filters' => null, 'properties' => [], ]; - if (!is_array($elems)) $elems = []; + if (!is_array($elems)) { + $elems = []; + } foreach ($elems as $elem) { - switch ($elem['name']) { - - case '{DAV:}prop' : + case '{DAV:}prop': $newProps['properties'] = array_keys($elem['value']); - if (isset($elem['value']['{' . Plugin::NS_CALDAV . '}calendar-data'])) { - $newProps += $elem['value']['{' . Plugin::NS_CALDAV . '}calendar-data']; + if (isset($elem['value']['{'.Plugin::NS_CALDAV.'}calendar-data'])) { + $newProps += $elem['value']['{'.Plugin::NS_CALDAV.'}calendar-data']; } break; - case '{' . Plugin::NS_CALDAV . '}filter' : + case '{'.Plugin::NS_CALDAV.'}filter': foreach ($elem['value'] as $subElem) { - if ($subElem['name'] === '{' . Plugin::NS_CALDAV . '}comp-filter') { + if ($subElem['name'] === '{'.Plugin::NS_CALDAV.'}comp-filter') { if (!is_null($newProps['filters'])) { throw new BadRequest('Only one top-level comp-filter may be defined'); } @@ -119,21 +122,18 @@ class CalendarQueryReport implements XmlDeserializable { } } break; - } - } if (is_null($newProps['filters'])) { - throw new BadRequest('The {' . Plugin::NS_CALDAV . '}filter element is required for this request'); + throw new BadRequest('The {'.Plugin::NS_CALDAV.'}filter element is required for this request'); } $obj = new self(); foreach ($newProps as $key => $value) { $obj->$key = $value; } - return $obj; + return $obj; } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Request/FreeBusyQueryReport.php b/vendor/sabre/dav/lib/CalDAV/Xml/Request/FreeBusyQueryReport.php index 0f6c1e074..a4d98a8d4 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Request/FreeBusyQueryReport.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Request/FreeBusyQueryReport.php @@ -1,5 +1,7 @@ parseInnerTree([]) as $elem) { - - if ($elem['name'] !== $timeRange) continue; + foreach ((array) $reader->parseInnerTree([]) as $elem) { + if ($elem['name'] !== $timeRange) { + continue; + } $start = empty($elem['attributes']['start']) ?: $elem['attributes']['start']; $end = empty($elem['attributes']['end']) ?: $elem['attributes']['end']; - } if (!$start && !$end) { throw new BadRequest('The freebusy report must have a time-range element'); @@ -85,7 +88,5 @@ class FreeBusyQueryReport implements XmlDeserializable { $result->end = $end; return $result; - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Request/InviteReply.php b/vendor/sabre/dav/lib/CalDAV/Xml/Request/InviteReply.php index db32cc6a5..710095bb2 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Request/InviteReply.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Request/InviteReply.php @@ -1,5 +1,7 @@ href = $href; $this->calendarUri = $calendarUri; $this->inReplyTo = $inReplyTo; $this->summary = $summary; $this->status = $status; - } /** @@ -98,10 +99,11 @@ class InviteReply implements XmlDeserializable { * the next element. * * @param Reader $reader + * * @return mixed */ - static function xmlDeserialize(Reader $reader) { - + public static function xmlDeserialize(Reader $reader) + { $elems = KeyValue::xmlDeserialize($reader); $href = null; @@ -111,40 +113,35 @@ class InviteReply implements XmlDeserializable { $status = null; foreach ($elems as $name => $value) { - switch ($name) { - - case '{' . Plugin::NS_CALENDARSERVER . '}hosturl' : + case '{'.Plugin::NS_CALENDARSERVER.'}hosturl': foreach ($value as $bla) { - if ($bla['name'] === '{DAV:}href') { + if ('{DAV:}href' === $bla['name']) { $calendarUri = $bla['value']; } } break; - case '{' . Plugin::NS_CALENDARSERVER . '}invite-accepted' : + case '{'.Plugin::NS_CALENDARSERVER.'}invite-accepted': $status = DAV\Sharing\Plugin::INVITE_ACCEPTED; break; - case '{' . Plugin::NS_CALENDARSERVER . '}invite-declined' : + case '{'.Plugin::NS_CALENDARSERVER.'}invite-declined': $status = DAV\Sharing\Plugin::INVITE_DECLINED; break; - case '{' . Plugin::NS_CALENDARSERVER . '}in-reply-to' : + case '{'.Plugin::NS_CALENDARSERVER.'}in-reply-to': $inReplyTo = $value; break; - case '{' . Plugin::NS_CALENDARSERVER . '}summary' : + case '{'.Plugin::NS_CALENDARSERVER.'}summary': $summary = $value; break; - case '{DAV:}href' : + case '{DAV:}href': $href = $value; break; } - } if (is_null($calendarUri)) { throw new BadRequest('The {http://calendarserver.org/ns/}hosturl/{DAV:}href element must exist'); } return new self($href, $calendarUri, $inReplyTo, $summary, $status); - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Request/MkCalendar.php b/vendor/sabre/dav/lib/CalDAV/Xml/Request/MkCalendar.php index ce7fafde9..7cad98da5 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Request/MkCalendar.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Request/MkCalendar.php @@ -1,5 +1,7 @@ properties; - } /** @@ -55,10 +56,11 @@ class MkCalendar implements XmlDeserializable { * the next element. * * @param Reader $reader + * * @return mixed */ - static function xmlDeserialize(Reader $reader) { - + public static function xmlDeserialize(Reader $reader) + { $self = new self(); $elementMap = $reader->elementMap; @@ -67,13 +69,11 @@ class MkCalendar implements XmlDeserializable { $elems = $reader->parseInnerTree($elementMap); foreach ($elems as $elem) { - if ($elem['name'] === '{DAV:}set') { + if ('{DAV:}set' === $elem['name']) { $self->properties = array_merge($self->properties, $elem['value']['{DAV:}prop']); } } return $self; - } - } diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Request/Share.php b/vendor/sabre/dav/lib/CalDAV/Xml/Request/Share.php index e0bd8e0af..60bd579d5 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Request/Share.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Request/Share.php @@ -1,5 +1,7 @@ sharees = $sharees; - } /** @@ -57,55 +58,52 @@ class Share implements XmlDeserializable { * the next element. * * @param Reader $reader + * * @return mixed */ - static function xmlDeserialize(Reader $reader) { - + public static function xmlDeserialize(Reader $reader) + { $elems = $reader->parseGetElements([ - '{' . Plugin::NS_CALENDARSERVER . '}set' => 'Sabre\\Xml\\Element\\KeyValue', - '{' . Plugin::NS_CALENDARSERVER . '}remove' => 'Sabre\\Xml\\Element\\KeyValue', + '{'.Plugin::NS_CALENDARSERVER.'}set' => 'Sabre\\Xml\\Element\\KeyValue', + '{'.Plugin::NS_CALENDARSERVER.'}remove' => 'Sabre\\Xml\\Element\\KeyValue', ]); $sharees = []; foreach ($elems as $elem) { switch ($elem['name']) { - - case '{' . Plugin::NS_CALENDARSERVER . '}set' : + case '{'.Plugin::NS_CALENDARSERVER.'}set': $sharee = $elem['value']; - $sumElem = '{' . Plugin::NS_CALENDARSERVER . '}summary'; - $commonName = '{' . Plugin::NS_CALENDARSERVER . '}common-name'; + $sumElem = '{'.Plugin::NS_CALENDARSERVER.'}summary'; + $commonName = '{'.Plugin::NS_CALENDARSERVER.'}common-name'; $properties = []; if (isset($sharee[$commonName])) { $properties['{DAV:}displayname'] = $sharee[$commonName]; } - $access = array_key_exists('{' . Plugin::NS_CALENDARSERVER . '}read-write', $sharee) + $access = array_key_exists('{'.Plugin::NS_CALENDARSERVER.'}read-write', $sharee) ? \Sabre\DAV\Sharing\Plugin::ACCESS_READWRITE : \Sabre\DAV\Sharing\Plugin::ACCESS_READ; $sharees[] = new Sharee([ - 'href' => $sharee['{DAV:}href'], + 'href' => $sharee['{DAV:}href'], 'properties' => $properties, - 'access' => $access, - 'comment' => isset($sharee[$sumElem]) ? $sharee[$sumElem] : null + 'access' => $access, + 'comment' => isset($sharee[$sumElem]) ? $sharee[$sumElem] : null, ]); break; - case '{' . Plugin::NS_CALENDARSERVER . '}remove' : + case '{'.Plugin::NS_CALENDARSERVER.'}remove': $sharees[] = new Sharee([ - 'href' => $elem['value']['{DAV:}href'], - 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_NOACCESS + 'href' => $elem['value']['{DAV:}href'], + 'access' => \Sabre\DAV\Sharing\Plugin::ACCESS_NOACCESS, ]); break; - } } return new self($sharees); - } - } -- cgit v1.2.3