diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-10-09 11:21:03 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-10-09 11:30:55 +0300 |
commit | 0a1e1ad8bc46bb4d4b0846b840cd6b8a4ff3c408 (patch) | |
tree | ca6e6906eeaa390bd334152d9c4915c7b3bd4701 /lib/IMAP | |
parent | 374e9fbbae219635168b3fab0a53a1c056db7ab4 (diff) |
Fix more type and nullable errors
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/IMAP')
-rw-r--r-- | lib/IMAP/MailboxSync.php | 6 | ||||
-rw-r--r-- | lib/IMAP/MessageMapper.php | 10 |
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/IMAP/MailboxSync.php b/lib/IMAP/MailboxSync.php index 563cbfe50..bf7108a85 100644 --- a/lib/IMAP/MailboxSync.php +++ b/lib/IMAP/MailboxSync.php @@ -96,7 +96,11 @@ class MailboxSync { $folders = $this->folderMapper->getFolders($account, $client); $this->folderMapper->getFoldersStatus($folders, $client); } catch (Horde_Imap_Client_Exception $e) { - throw new ServiceException("IMAP error" . $e->getMessage(), $e->getCode(), $e); + throw new ServiceException( + "IMAP error" . $e->getMessage(), + (int) $e->getCode(), + $e + ); } $this->folderMapper->detectFolderSpecialUse($folders); diff --git a/lib/IMAP/MessageMapper.php b/lib/IMAP/MessageMapper.php index 2abfdad40..e5b0e46a6 100644 --- a/lib/IMAP/MessageMapper.php +++ b/lib/IMAP/MessageMapper.php @@ -129,7 +129,7 @@ class MessageMapper { // Determine min UID to fetch, but don't exceed the known maximum $lower = max( $min, - ($highestKnownUid ?? 0) + 1 + $highestKnownUid + 1 ); // Determine max UID to fetch, but don't exceed the known maximum $upper = min( @@ -170,7 +170,7 @@ class MessageMapper { function (int $uid) use ($highestKnownUid) { // Don't load the ones we already know - return $highestKnownUid === null || $uid > $highestKnownUid; + return $uid > $highestKnownUid; } ), 0, @@ -379,7 +379,11 @@ class MessageMapper { 'ids' => new Horde_Imap_Client_Ids($uid), ]), false); } catch (Horde_Imap_Client_Exception $e) { - throw new ServiceException("Could not fetch message source: " . $e->getMessage(), $e->getCode(), $e); + throw new ServiceException( + "Could not fetch message source: " . $e->getMessage(), + (int) $e->getCode(), + $e + ); } $msg = array_map(function (Horde_Imap_Client_Data_Fetch $result) { |