From 9b10ec69d8fa56a1920c9dc4ad6ef131aa8cf0eb Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 20 Mar 2023 17:40:19 +0100 Subject: [PATCH] fix(sync): Fix PHPDoc to allow getChanges for sync to return null As per the comments: "If the syncToken is expired (due to data cleanup) or unknown, you must return null." Signed-off-by: Thomas Citharel --- lib/CalDAV/Backend/PDO.php | 2 +- lib/CalDAV/Backend/SyncSupport.php | 2 +- lib/CalDAV/Calendar.php | 2 +- lib/CardDAV/AddressBook.php | 2 +- lib/CardDAV/Backend/PDO.php | 2 +- lib/CardDAV/Backend/SyncSupport.php | 2 +- lib/DAV/Sync/ISyncCollection.php | 2 +- tests/Sabre/DAV/Sync/MockSyncCollection.php | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/CalDAV/Backend/PDO.php b/lib/CalDAV/Backend/PDO.php index 2f48ab9828..b9f112cf8d 100644 --- a/lib/CalDAV/Backend/PDO.php +++ b/lib/CalDAV/Backend/PDO.php @@ -939,7 +939,7 @@ public function getCalendarObjectByUID($principalUri, $uid) * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null) { diff --git a/lib/CalDAV/Backend/SyncSupport.php b/lib/CalDAV/Backend/SyncSupport.php index c7f67d1761..bfc1dafc2e 100644 --- a/lib/CalDAV/Backend/SyncSupport.php +++ b/lib/CalDAV/Backend/SyncSupport.php @@ -77,7 +77,7 @@ interface SyncSupport extends BackendInterface * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null); } diff --git a/lib/CalDAV/Calendar.php b/lib/CalDAV/Calendar.php index 6e989314dc..3d063feb7d 100644 --- a/lib/CalDAV/Calendar.php +++ b/lib/CalDAV/Calendar.php @@ -442,7 +442,7 @@ public function getSyncToken() * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChanges($syncToken, $syncLevel, $limit = null) { diff --git a/lib/CardDAV/AddressBook.php b/lib/CardDAV/AddressBook.php index 86994f2d5f..8487d4c3f8 100644 --- a/lib/CardDAV/AddressBook.php +++ b/lib/CardDAV/AddressBook.php @@ -317,7 +317,7 @@ public function getSyncToken() * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChanges($syncToken, $syncLevel, $limit = null) { diff --git a/lib/CardDAV/Backend/PDO.php b/lib/CardDAV/Backend/PDO.php index 966d7ba095..4ca9284a9e 100644 --- a/lib/CardDAV/Backend/PDO.php +++ b/lib/CardDAV/Backend/PDO.php @@ -452,7 +452,7 @@ public function deleteCard($addressBookId, $cardUri) * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null) { diff --git a/lib/CardDAV/Backend/SyncSupport.php b/lib/CardDAV/Backend/SyncSupport.php index 071361ed02..6aaad14154 100644 --- a/lib/CardDAV/Backend/SyncSupport.php +++ b/lib/CardDAV/Backend/SyncSupport.php @@ -77,7 +77,7 @@ interface SyncSupport extends BackendInterface * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null); } diff --git a/lib/DAV/Sync/ISyncCollection.php b/lib/DAV/Sync/ISyncCollection.php index 4ca69dc894..c829716b74 100644 --- a/lib/DAV/Sync/ISyncCollection.php +++ b/lib/DAV/Sync/ISyncCollection.php @@ -84,7 +84,7 @@ public function getSyncToken(); * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChanges($syncToken, $syncLevel, $limit = null); } diff --git a/tests/Sabre/DAV/Sync/MockSyncCollection.php b/tests/Sabre/DAV/Sync/MockSyncCollection.php index 2fbaea19f1..d24ba0af72 100644 --- a/tests/Sabre/DAV/Sync/MockSyncCollection.php +++ b/tests/Sabre/DAV/Sync/MockSyncCollection.php @@ -98,7 +98,7 @@ public function addChange(array $added, array $modified, array $deleted) * @param int $syncLevel * @param int $limit * - * @return array + * @return array|null */ public function getChanges($syncToken, $syncLevel, $limit = null) {