aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/dav/lib/CalDAV/Xml/Notification
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/dav/lib/CalDAV/Xml/Notification')
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Xml/Notification/Invite.php108
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Xml/Notification/InviteReply.php80
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Xml/Notification/NotificationInterface.php16
-rw-r--r--vendor/sabre/dav/lib/CalDAV/Xml/Notification/SystemStatus.php69
4 files changed, 125 insertions, 148 deletions
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 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\CalDAV\Xml\Notification;
use Sabre\CalDAV;
@@ -17,19 +19,19 @@ use Sabre\Xml\Writer;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class Invite implements NotificationInterface {
-
+class Invite implements NotificationInterface
+{
/**
- * A unique id for the message
+ * A unique id for the message.
*
* @var string
*/
protected $id;
/**
- * Timestamp of the notification
+ * Timestamp of the notification.
*
- * @var DateTime
+ * @var \DateTime
*/
protected $dtStamp;
@@ -63,7 +65,7 @@ class Invite implements NotificationInterface {
protected $hostUrl;
/**
- * Url to the sharer of the calendar
+ * Url to the sharer of the calendar.
*
* @var string
*/
@@ -91,21 +93,21 @@ class Invite implements NotificationInterface {
protected $lastName;
/**
- * A description of the share request
+ * A description of the share request.
*
* @var string
*/
protected $summary;
/**
- * The Etag for the notification
+ * The Etag for the notification.
*
* @var string
*/
protected $etag;
/**
- * The list of supported components
+ * The list of supported components.
*
* @var CalDAV\Xml\Property\SupportedCalendarComponentSet
*/
@@ -138,8 +140,8 @@ class Invite implements NotificationInterface {
*
* @param array $values All the options
*/
- function __construct(array $values) {
-
+ public function __construct(array $values)
+ {
$required = [
'id',
'etag',
@@ -152,17 +154,16 @@ class Invite implements NotificationInterface {
];
foreach ($required as $item) {
if (!isset($values[$item])) {
- throw new \InvalidArgumentException($item . ' is a required constructor option');
+ throw new \InvalidArgumentException($item.' is a required constructor option');
}
}
foreach ($values as $key => $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 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\CalDAV\Xml\Notification;
use Sabre\CalDAV;
@@ -14,19 +16,19 @@ use Sabre\Xml\Writer;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class InviteReply implements NotificationInterface {
-
+class InviteReply implements NotificationInterface
+{
/**
- * A unique id for the message
+ * A unique id for the message.
*
* @var string
*/
protected $id;
/**
- * Timestamp of the notification
+ * Timestamp of the notification.
*
- * @var DateTime
+ * @var \DateTime
*/
protected $dtStamp;
@@ -59,14 +61,14 @@ class InviteReply implements NotificationInterface {
protected $hostUrl;
/**
- * A description of the share request
+ * A description of the share request.
*
* @var string
*/
protected $summary;
/**
- * Notification Etag
+ * Notification Etag.
*
* @var string
*/
@@ -90,8 +92,8 @@ class InviteReply implements NotificationInterface {
*
* @param array $values
*/
- function __construct(array $values) {
-
+ public function __construct(array $values)
+ {
$required = [
'id',
'etag',
@@ -103,17 +105,16 @@ class InviteReply implements NotificationInterface {
];
foreach ($required as $item) {
if (!isset($values[$item])) {
- throw new \InvalidArgumentException($item . ' is a required constructor option');
+ throw new \InvalidArgumentException($item.' is a required constructor option');
}
}
foreach ($values as $key => $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 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\CalDAV\Xml\Notification;
use Sabre\Xml\Writer;
@@ -12,26 +14,25 @@ use Sabre\Xml\XmlSerializable;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-interface NotificationInterface extends XmlSerializable {
-
+interface NotificationInterface extends XmlSerializable
+{
/**
* This method serializes the entire notification, as it is used in the
* response body.
*
* @param Writer $writer
- * @return void
*/
- function xmlSerializeFull(Writer $writer);
+ public function xmlSerializeFull(Writer $writer);
/**
- * 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();
/**
* Returns the ETag for this notification.
@@ -40,6 +41,5 @@ interface NotificationInterface extends XmlSerializable {
*
* @return string
*/
- function getETag();
-
+ public function getETag();
}
diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Notification/SystemStatus.php b/vendor/sabre/dav/lib/CalDAV/Xml/Notification/SystemStatus.php
index 8c945dd68..3c656df34 100644
--- a/vendor/sabre/dav/lib/CalDAV/Xml/Notification/SystemStatus.php
+++ b/vendor/sabre/dav/lib/CalDAV/Xml/Notification/SystemStatus.php
@@ -1,12 +1,14 @@
<?php
+declare(strict_types=1);
+
namespace Sabre\CalDAV\Xml\Notification;
use Sabre\CalDAV\Plugin;
use Sabre\Xml\Writer;
/**
- * SystemStatus notification
+ * SystemStatus notification.
*
* This notification can be used to indicate to the user that the system is
* down.
@@ -15,14 +17,14 @@ use Sabre\Xml\Writer;
* @author Evert Pot (http://evertpot.com/)
* @license http://sabre.io/license/ Modified BSD License
*/
-class SystemStatus implements NotificationInterface {
-
+class SystemStatus implements NotificationInterface
+{
const TYPE_LOW = 1;
const TYPE_MEDIUM = 2;
const TYPE_HIGH = 3;
/**
- * A unique id
+ * A unique id.
*
* @var string
*/
@@ -50,7 +52,7 @@ class SystemStatus implements NotificationInterface {
protected $href;
/**
- * Notification Etag
+ * Notification Etag.
*
* @var string
*/
@@ -64,18 +66,17 @@ class SystemStatus implements NotificationInterface {
*
* @param string $id
* @param string $etag
- * @param int $type
+ * @param int $type
* @param string $description
* @param string $href
*/
- function __construct($id, $etag, $type = self::TYPE_HIGH, $description = null, $href = null) {
-
+ public function __construct($id, $etag, $type = self::TYPE_HIGH, $description = null, $href = null)
+ {
$this->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;
-
}
-
}