diff options
author | Mario <mario@mariovavti.com> | 2019-11-10 12:49:51 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-11-10 14:10:03 +0100 |
commit | 580c3f4ffe9608d2beb56d418c68b3b112420e76 (patch) | |
tree | 82335d01179ac361d3f547a4b8e8c598d302e9f3 /vendor/sabre/dav/lib/CalDAV/Xml | |
parent | d22766f458a8539a40a57f3946459a9be1f21cd6 (diff) | |
download | volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.gz volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.tar.bz2 volse-hubzilla-580c3f4ffe9608d2beb56d418c68b3b112420e76.zip |
another bulk of composer updates
(cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce)
Diffstat (limited to 'vendor/sabre/dav/lib/CalDAV/Xml')
21 files changed, 421 insertions, 479 deletions
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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Filter; use Sabre\CalDAV\Plugin; @@ -25,8 +27,8 @@ use Sabre\Xml\XmlDeserializable; * @author Evert Pot (http://www.rooftopsolutions.nl/) * @license http://sabre.io/license/ Modified BSD License */ -class CalendarData implements XmlDeserializable { - +class CalendarData implements XmlDeserializable +{ /** * The deserialize method is called during xml parsing. * @@ -46,24 +48,24 @@ class CalendarData implements XmlDeserializable { * the next element. * * @param Reader $reader + * * @return mixed */ - static function xmlDeserialize(Reader $reader) { - + public static function xmlDeserialize(Reader $reader) + { $result = [ 'contentType' => $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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Filter; use Sabre\CalDAV\Plugin; @@ -22,8 +24,8 @@ use Sabre\Xml\XmlDeserializable; * @author Evert Pot (http://www.rooftopsolutions.nl/) * @license http://sabre.io/license/ Modified BSD License */ -class CompFilter implements XmlDeserializable { - +class CompFilter implements XmlDeserializable +{ /** * The deserialize method is called during xml parsing. * @@ -43,16 +45,17 @@ class CompFilter implements XmlDeserializable { * the next element. * * @param Reader $reader + * * @return mixed */ - static function xmlDeserialize(Reader $reader) { - + public static function xmlDeserialize(Reader $reader) + { $result = [ - 'name' => 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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Filter; use Sabre\CalDAV\Plugin; @@ -20,8 +22,8 @@ use Sabre\Xml\XmlDeserializable; * @author Evert Pot (http://www.rooftopsolutions.nl/) * @license http://sabre.io/license/ Modified BSD License */ -class ParamFilter implements XmlDeserializable { - +class ParamFilter implements XmlDeserializable +{ /** * The deserialize method is called during xml parsing. * @@ -41,14 +43,15 @@ class ParamFilter implements XmlDeserializable { * the next element. * * @param Reader $reader + * * @return mixed */ - static function xmlDeserialize(Reader $reader) { - + public static function xmlDeserialize(Reader $reader) + { $result = [ - 'name' => 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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Filter; use Sabre\CalDAV\Plugin; @@ -22,8 +24,8 @@ use Sabre\Xml\XmlDeserializable; * @author Evert Pot (http://www.rooftopsolutions.nl/) * @license http://sabre.io/license/ Modified BSD License */ -class PropFilter implements XmlDeserializable { - +class PropFilter implements XmlDeserializable +{ /** * The deserialize method is called during xml parsing. * @@ -43,16 +45,17 @@ class PropFilter implements XmlDeserializable { * the next element. * * @param Reader $reader + * * @return mixed */ - static function xmlDeserialize(Reader $reader) { - + public static function xmlDeserialize(Reader $reader) + { $result = [ - 'name' => 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 @@ <?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; - } - } 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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Property; use Sabre\CalDAV\Plugin; @@ -7,7 +9,7 @@ use Sabre\Xml\Writer; use Sabre\Xml\XmlSerializable; /** - * AllowedSharingModes + * AllowedSharingModes. * * This property encodes the 'allowed-sharing-modes' property, as defined by * the 'caldav-sharing-02' spec, in the http://calendarserver.org/ns/ @@ -18,14 +20,15 @@ use Sabre\Xml\XmlSerializable; * such as VEVENT, VTODO * * @see https://trac.calendarserver.org/browser/CalendarServer/trunk/doc/Extensions/caldav-sharing-02.txt + * * @copyright Copyright (C) fruux GmbH (https://fruux.com/) * @author Evert Pot (http://www.rooftopsolutions.nl/) * @license http://sabre.io/license/ Modified BSD License */ -class AllowedSharingModes implements XmlSerializable { - +class AllowedSharingModes implements XmlSerializable +{ /** - * Whether or not a calendar can be shared with another user + * Whether or not a calendar can be shared with another user. * * @var bool */ @@ -39,17 +42,15 @@ class AllowedSharingModes implements XmlSerializable { protected $canBePublished; /** - * Constructor + * Constructor. * * @param bool $canBeShared * @param bool $canBePublished - * @return void */ - function __construct($canBeShared, $canBePublished) { - + public function __construct($canBeShared, $canBePublished) + { $this->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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Property; use Sabre\Xml\Writer; use Sabre\Xml\XmlSerializable; /** - * email-address-set property + * email-address-set property. * * This property represents the email-address-set property in the * http://calendarserver.org/ns/ namespace. @@ -17,35 +19,33 @@ use Sabre\Xml\XmlSerializable; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class EmailAddressSet implements XmlSerializable { - +class EmailAddressSet implements XmlSerializable +{ /** - * emails + * emails. * * @var array */ private $emails; /** - * __construct + * __construct. * * @param array $emails */ - function __construct(array $emails) { - + public function __construct(array $emails) + { $this->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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Property; use Sabre\CalDAV\Plugin; @@ -9,19 +11,20 @@ use Sabre\Xml\Writer; use Sabre\Xml\XmlSerializable; /** - * Invite property + * Invite property. * * This property encodes the 'invite' property, as defined by * the 'caldav-sharing-02' spec, in the http://calendarserver.org/ns/ * namespace. * * @see https://trac.calendarserver.org/browser/CalendarServer/trunk/doc/Extensions/caldav-sharing-02.txt + * * @copyright Copyright (C) fruux GmbH (https://fruux.com/) * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class Invite implements XmlSerializable { - +class Invite implements XmlSerializable +{ /** * The list of users a calendar has been shared to. * @@ -34,10 +37,9 @@ class Invite implements XmlSerializable { * * @param Sharee[] $sharees */ - function __construct(array $sharees) { - + public function __construct(array $sharees) + { $this->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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Property; use Sabre\CalDAV\Plugin; @@ -24,41 +26,39 @@ use Sabre\Xml\Writer; * @author Evert Pot (http://www.rooftopsolutions.nl/) * @license http://sabre.io/license/ Modified BSD License */ -class ScheduleCalendarTransp implements Element { - +class ScheduleCalendarTransp implements Element +{ const TRANSPARENT = 'transparent'; const OPAQUE = 'opaque'; /** - * value + * value. * * @var string */ protected $value; /** - * Creates the property + * Creates the property. * * @param string $value */ - function __construct($value) { - - if ($value !== self::TRANSPARENT && $value !== self::OPAQUE) { + public function __construct($value) + { + if (self::TRANSPARENT !== $value && self::OPAQUE !== $value) { throw new \InvalidArgumentException('The value must either be specified as "transparent" or "opaque"'); } $this->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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Property; use Sabre\CalDAV\Plugin; @@ -21,8 +23,8 @@ use Sabre\Xml\Writer; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class SupportedCalendarComponentSet implements Element { - +class SupportedCalendarComponentSet implements Element +{ /** * List of supported components. * @@ -37,21 +39,19 @@ class SupportedCalendarComponentSet implements Element { * * @param array $components */ - function __construct(array $components) { - + public function __construct(array $components) + { $this->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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Property; use Sabre\CalDAV\Plugin; @@ -7,7 +9,7 @@ use Sabre\Xml\Writer; use Sabre\Xml\XmlSerializable; /** - * Supported-calendar-data property + * Supported-calendar-data property. * * This property is a representation of the supported-calendar-data property * in the CalDAV namespace. SabreDAV only has support for text/calendar;2.0 @@ -20,8 +22,8 @@ use Sabre\Xml\XmlSerializable; * @author Evert Pot (http://www.rooftopsolutions.nl/) * @license http://sabre.io/license/ Modified BSD License */ -class SupportedCalendarData implements XmlSerializable { - +class SupportedCalendarData implements XmlSerializable +{ /** * The xmlSerialize method is called during xml writing. * @@ -39,22 +41,19 @@ class SupportedCalendarData implements XmlSerializable { * If you are opening new elements, you must also close them again. * * @param Writer $writer - * @return void */ - function xmlSerialize(Writer $writer) { - - $writer->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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Property; use Sabre\CalDAV\Plugin; @@ -7,7 +9,7 @@ use Sabre\Xml\Writer; use Sabre\Xml\XmlSerializable; /** - * supported-collation-set property + * supported-collation-set property. * * This property is a representation of the supported-collation-set property * in the CalDAV namespace. @@ -19,8 +21,8 @@ use Sabre\Xml\XmlSerializable; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class SupportedCollationSet implements XmlSerializable { - +class SupportedCollationSet implements XmlSerializable +{ /** * The xmlSerialize method is called during xml writing. * @@ -38,20 +40,17 @@ class SupportedCollationSet 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) + { $collations = [ 'i;ascii-casemap', 'i;octet', - 'i;unicode-casemap' + 'i;unicode-casemap', ]; foreach ($collations as $collation) { - $writer->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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Request; use Sabre\CalDAV\Plugin; @@ -19,8 +21,8 @@ use Sabre\Xml\XmlDeserializable; * @author Evert Pot (http://www.rooftopsolutions.nl/) * @license http://sabre.io/license/ Modified BSD License */ -class CalendarMultiGetReport implements XmlDeserializable { - +class CalendarMultiGetReport implements XmlDeserializable +{ /** * An array with requested properties. * @@ -80,36 +82,33 @@ class CalendarMultiGetReport implements XmlDeserializable { * the next element. * * @param Reader $reader + * * @return mixed */ - static function xmlDeserialize(Reader $reader) { - + public static function xmlDeserialize(Reader $reader) + { $elems = $reader->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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Request; use Sabre\CalDAV\Plugin; @@ -19,8 +21,8 @@ use Sabre\Xml\XmlDeserializable; * @author Evert Pot (http://www.rooftopsolutions.nl/) * @license http://sabre.io/license/ Modified BSD License */ -class CalendarQueryReport implements XmlDeserializable { - +class CalendarQueryReport implements XmlDeserializable +{ /** * An array with requested properties. * @@ -80,38 +82,39 @@ class CalendarQueryReport implements XmlDeserializable { * the next element. * * @param Reader $reader + * * @return mixed */ - static function xmlDeserialize(Reader $reader) { - + public static function xmlDeserialize(Reader $reader) + { $elems = $reader->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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Request; use Sabre\CalDAV\Plugin; @@ -9,7 +11,7 @@ use Sabre\Xml\Reader; use Sabre\Xml\XmlDeserializable; /** - * FreeBusyQueryReport + * FreeBusyQueryReport. * * This class parses the {DAV:}free-busy-query REPORT, as defined in: * @@ -19,19 +21,19 @@ use Sabre\Xml\XmlDeserializable; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class FreeBusyQueryReport implements XmlDeserializable { - +class FreeBusyQueryReport implements XmlDeserializable +{ /** - * Starttime of report + * Starttime of report. * - * @var DateTime|null + * @var \DateTime|null */ public $start; /** - * End time of report + * End time of report. * - * @var DateTime|null + * @var \DateTime|null */ public $end; @@ -54,22 +56,23 @@ class FreeBusyQueryReport implements XmlDeserializable { * the next element. * * @param Reader $reader + * * @return mixed */ - static function xmlDeserialize(Reader $reader) { - - $timeRange = '{' . Plugin::NS_CALDAV . '}time-range'; + public static function xmlDeserialize(Reader $reader) + { + $timeRange = '{'.Plugin::NS_CALDAV.'}time-range'; $start = null; $end = null; - foreach ((array)$reader->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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Request; use Sabre\CalDAV\Plugin; @@ -11,7 +13,7 @@ use Sabre\Xml\Reader; use Sabre\Xml\XmlDeserializable; /** - * Invite-reply POST request parser + * Invite-reply POST request parser. * * This class parses the invite-reply POST request, as defined in: * @@ -21,8 +23,8 @@ use Sabre\Xml\XmlDeserializable; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class InviteReply implements XmlDeserializable { - +class InviteReply implements XmlDeserializable +{ /** * The sharee calendar user address. * @@ -40,14 +42,14 @@ class InviteReply implements XmlDeserializable { public $calendarUri; /** - * The id of the invite message that's being responded to + * The id of the invite message that's being responded to. * * @var string */ public $inReplyTo; /** - * An optional message + * An optional message. * * @var string */ @@ -61,22 +63,21 @@ class InviteReply implements XmlDeserializable { public $status; /** - * Constructor + * Constructor. * * @param string $href * @param string $calendarUri * @param string $inReplyTo * @param string $summary - * @param int $status + * @param int $status */ - function __construct($href, $calendarUri, $inReplyTo, $summary, $status) { - + public function __construct($href, $calendarUri, $inReplyTo, $summary, $status) + { $this->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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Request; use Sabre\Xml\Reader; @@ -16,8 +18,8 @@ use Sabre\Xml\XmlDeserializable; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class MkCalendar implements XmlDeserializable { - +class MkCalendar implements XmlDeserializable +{ /** * The list of properties that will be set. * @@ -30,10 +32,9 @@ class MkCalendar implements XmlDeserializable { * * @return array */ - function getProperties() { - + public function getProperties() + { return $this->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 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Xml\Request; use Sabre\CalDAV\Plugin; @@ -8,7 +10,7 @@ use Sabre\Xml\Reader; use Sabre\Xml\XmlDeserializable; /** - * Share POST request parser + * Share POST request parser. * * This class parses the share POST request, as defined in: * @@ -18,8 +20,8 @@ use Sabre\Xml\XmlDeserializable; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class Share implements XmlDeserializable { - +class Share implements XmlDeserializable +{ /** * The list of new people added or updated or removed from the share. * @@ -28,14 +30,13 @@ class Share implements XmlDeserializable { public $sharees = []; /** - * Constructor + * Constructor. * * @param Sharee[] $sharees */ - function __construct(array $sharees) { - + public function __construct(array $sharees) + { $this->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); - } - } |