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/Notification/Invite.php | 108 ++++++++++----------- 1 file changed, 50 insertions(+), 58 deletions(-) (limited to 'vendor/sabre/dav/lib/CalDAV/Xml/Notification/Invite.php') 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; - } - } -- cgit v1.2.3