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/Backend/AbstractBackend.php | |
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/Backend/AbstractBackend.php')
-rw-r--r-- | vendor/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php | 70 |
1 files changed, 33 insertions, 37 deletions
diff --git a/vendor/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php b/vendor/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php index 311b1c415..336e104c8 100644 --- a/vendor/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php +++ b/vendor/sabre/dav/lib/CalDAV/Backend/AbstractBackend.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Sabre\CalDAV\Backend; use Sabre\CalDAV; @@ -14,8 +16,8 @@ use Sabre\VObject; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -abstract class AbstractBackend implements BackendInterface { - +abstract class AbstractBackend implements BackendInterface +{ /** * Updates properties for a calendar. * @@ -28,12 +30,11 @@ abstract class AbstractBackend implements BackendInterface { * * Read the PropPatch documentation for more info and examples. * - * @param mixed $calendarId + * @param mixed $calendarId * @param \Sabre\DAV\PropPatch $propPatch - * @return void */ - function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch) { - + public function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch) + { } /** @@ -46,14 +47,14 @@ abstract class AbstractBackend implements BackendInterface { * * @param mixed $calendarId * @param array $uris + * * @return array */ - function getMultipleCalendarObjects($calendarId, array $uris) { - - return array_map(function($uri) use ($calendarId) { + public function getMultipleCalendarObjects($calendarId, array $uris) + { + return array_map(function ($uri) use ($calendarId) { return $this->getCalendarObject($calendarId, $uri); }, $uris); - } /** @@ -103,23 +104,21 @@ abstract class AbstractBackend implements BackendInterface { * * @param mixed $calendarId * @param array $filters + * * @return array */ - function calendarQuery($calendarId, array $filters) { - + public function calendarQuery($calendarId, array $filters) + { $result = []; $objects = $this->getCalendarObjects($calendarId); foreach ($objects as $object) { - if ($this->validateFilterForObject($object, $filters)) { $result[] = $object['uri']; } - } return $result; - } /** @@ -128,10 +127,11 @@ abstract class AbstractBackend implements BackendInterface { * * @param array $object * @param array $filters + * * @return bool */ - protected function validateFilterForObject(array $object, array $filters) { - + protected function validateFilterForObject(array $object, array $filters) + { // Unfortunately, setting the 'calendardata' here is optional. If // it was excluded, we actually need another call to get this as // well. @@ -148,7 +148,6 @@ abstract class AbstractBackend implements BackendInterface { $vObject->destroy(); return $result; - } /** @@ -168,14 +167,14 @@ abstract class AbstractBackend implements BackendInterface { * * @param string $principalUri * @param string $uid + * * @return string|null */ - function getCalendarObjectByUID($principalUri, $uid) { - + public function getCalendarObjectByUID($principalUri, $uid) + { // Note: this is a super slow naive implementation of this method. You // are highly recommended to optimize it, if your backend allows it. foreach ($this->getCalendarsForUser($principalUri) as $calendar) { - // We must ignore calendars owned by other principals. if ($calendar['principaluri'] !== $principalUri) { continue; @@ -189,38 +188,35 @@ abstract class AbstractBackend implements BackendInterface { $results = $this->calendarQuery( $calendar['id'], [ - 'name' => 'VCALENDAR', + 'name' => 'VCALENDAR', 'prop-filters' => [], 'comp-filters' => [ [ - 'name' => 'VEVENT', + 'name' => 'VEVENT', 'is-not-defined' => false, - 'time-range' => null, - 'comp-filters' => [], - 'prop-filters' => [ + 'time-range' => null, + 'comp-filters' => [], + 'prop-filters' => [ [ - 'name' => 'UID', + 'name' => 'UID', 'is-not-defined' => false, - 'time-range' => null, - 'text-match' => [ - 'value' => $uid, + 'time-range' => null, + 'text-match' => [ + 'value' => $uid, 'negate-condition' => false, - 'collation' => 'i;octet', + 'collation' => 'i;octet', ], 'param-filters' => [], ], - ] - ] + ], + ], ], ] ); if ($results) { // We have a match - return $calendar['uri'] . '/' . $results[0]; + return $calendar['uri'].'/'.$results[0]; } - } - } - } |