diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2022-03-17 12:39:25 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2022-05-23 14:45:29 +0300 |
commit | 91610d422441496c6ce77e4c13d65d056b2be65a (patch) | |
tree | c2f5626329601645030160a17e7788fe83a1917e /lib | |
parent | 28d61094d836f20bdc627265c7802c3bebabbd55 (diff) |
Add PHP8.1 support
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Account.php | 5 | ||||
-rw-r--r-- | lib/Address.php | 7 | ||||
-rw-r--r-- | lib/AddressList.php | 5 | ||||
-rw-r--r-- | lib/Db/Alias.php | 4 | ||||
-rw-r--r-- | lib/Db/LocalAttachment.php | 2 | ||||
-rw-r--r-- | lib/Db/LocalMessage.php | 5 | ||||
-rw-r--r-- | lib/Db/Mailbox.php | 2 | ||||
-rw-r--r-- | lib/Db/Message.php | 2 | ||||
-rw-r--r-- | lib/Db/Provisioning.php | 5 | ||||
-rw-r--r-- | lib/Db/Recipient.php | 4 | ||||
-rw-r--r-- | lib/Db/Tag.php | 6 | ||||
-rw-r--r-- | lib/Db/TrustedSender.php | 2 | ||||
-rw-r--r-- | lib/IMAP/MailboxStats.php | 2 | ||||
-rw-r--r-- | lib/IMAP/Sync/Response.php | 4 | ||||
-rw-r--r-- | lib/IMAP/Threading/DatabaseMessage.php | 4 | ||||
-rw-r--r-- | lib/IMAP/Threading/Message.php | 4 | ||||
-rw-r--r-- | lib/Model/IMAPMessage.php | 7 | ||||
-rw-r--r-- | lib/Service/Avatar/Avatar.php | 7 | ||||
-rw-r--r-- | lib/Service/Quota.php | 2 |
19 files changed, 47 insertions, 32 deletions
diff --git a/lib/Account.php b/lib/Account.php index c6c3bb2f4..0d285331f 100644 --- a/lib/Account.php +++ b/lib/Account.php @@ -50,6 +50,7 @@ use OCA\Mail\Model\Message; use OCP\ICacheFactory; use OCP\IConfig; use OCP\Security\ICrypto; +use ReturnTypeWillChange; class Account implements JsonSerializable { @@ -189,9 +190,7 @@ class Account implements JsonSerializable { ); } - /** - * @return array - */ + #[ReturnTypeWillChange] public function jsonSerialize() { return $this->account->toJson(); } diff --git a/lib/Address.php b/lib/Address.php index 119659b27..abc93d75c 100644 --- a/lib/Address.php +++ b/lib/Address.php @@ -28,6 +28,7 @@ namespace OCA\Mail; use Horde_Mail_Rfc822_Address; use JsonSerializable; +use ReturnTypeWillChange; /** * @psalm-immutable @@ -99,10 +100,8 @@ class Address implements JsonSerializable { return $this->wrapped; } - /** - * @return array - */ - public function jsonSerialize(): array { + #[ReturnTypeWillChange] + public function jsonSerialize() { return [ 'label' => $this->getLabel(), 'email' => $this->getEmail(), diff --git a/lib/AddressList.php b/lib/AddressList.php index 389395eca..bb06242db 100644 --- a/lib/AddressList.php +++ b/lib/AddressList.php @@ -31,6 +31,7 @@ use Horde_Mail_Rfc822_Address; use Horde_Mail_Rfc822_List; use Horde_Mail_Rfc822_Object; use JsonSerializable; +use ReturnTypeWillChange; /** * @psalm-immutable @@ -95,9 +96,7 @@ class AddressList implements Countable, JsonSerializable { return $this->addresses[0]; } - /** - * @return array - */ + #[ReturnTypeWillChange] public function jsonSerialize() { return array_map(function (Address $address) { return $address->jsonSerialize(); diff --git a/lib/Db/Alias.php b/lib/Db/Alias.php index 812682678..76ff18aa6 100644 --- a/lib/Db/Alias.php +++ b/lib/Db/Alias.php @@ -25,6 +25,7 @@ namespace OCA\Mail\Db; use JsonSerializable; use OCP\AppFramework\Db\Entity; +use ReturnTypeWillChange; /** * @method void setAccountId(int $accountId) @@ -66,7 +67,8 @@ class Alias extends Entity implements JsonSerializable { return $this->getProvisioningId() !== null; } - public function jsonSerialize(): array { + #[ReturnTypeWillChange] + public function jsonSerialize() { return [ 'id' => $this->getId(), 'name' => $this->getName(), diff --git a/lib/Db/LocalAttachment.php b/lib/Db/LocalAttachment.php index 9b64bf855..20771cde1 100644 --- a/lib/Db/LocalAttachment.php +++ b/lib/Db/LocalAttachment.php @@ -26,6 +26,7 @@ namespace OCA\Mail\Db; use JsonSerializable; use OCP\AppFramework\Db\Entity; +use ReturnTypeWillChange; /** * @method string getUserId() @@ -56,6 +57,7 @@ class LocalAttachment extends Entity implements JsonSerializable { /** @var int|null */ protected $localMessageId; + #[ReturnTypeWillChange] public function jsonSerialize() { return [ 'id' => $this->id, diff --git a/lib/Db/LocalMessage.php b/lib/Db/LocalMessage.php index 5adf551a0..b555b890d 100644 --- a/lib/Db/LocalMessage.php +++ b/lib/Db/LocalMessage.php @@ -27,6 +27,7 @@ namespace OCA\Mail\Db; use JsonSerializable; use OCP\AppFramework\Db\Entity; +use ReturnTypeWillChange; use function array_filter; /** @@ -92,9 +93,7 @@ class LocalMessage extends Entity implements JsonSerializable { $this->addType('html', 'boolean'); } - /** - * @return array - */ + #[ReturnTypeWillChange] public function jsonSerialize() { return [ 'id' => $this->getId(), diff --git a/lib/Db/Mailbox.php b/lib/Db/Mailbox.php index 1df1c86a3..a0b78e2e9 100644 --- a/lib/Db/Mailbox.php +++ b/lib/Db/Mailbox.php @@ -28,6 +28,7 @@ namespace OCA\Mail\Db; use JsonSerializable; use OCA\Mail\IMAP\MailboxStats; use OCP\AppFramework\Db\Entity; +use ReturnTypeWillChange; use function base64_encode; use function in_array; use function json_decode; @@ -146,6 +147,7 @@ class Mailbox extends Entity implements JsonSerializable { return new MailboxStats($this->getMessages(), $this->getUnseen()); } + #[ReturnTypeWillChange] public function jsonSerialize() { $specialUse = $this->getSpecialUseParsed(); return [ diff --git a/lib/Db/Message.php b/lib/Db/Message.php index e989f21f1..5eb1c5141 100644 --- a/lib/Db/Message.php +++ b/lib/Db/Message.php @@ -29,6 +29,7 @@ use Horde_Mail_Rfc822_Identification; use JsonSerializable; use OCA\Mail\AddressList; use OCP\AppFramework\Db\Entity; +use ReturnTypeWillChange; use function in_array; use function json_decode; use function json_encode; @@ -274,6 +275,7 @@ class Message extends Entity implements JsonSerializable { } } + #[ReturnTypeWillChange] public function jsonSerialize() { $tags = $this->getTags(); $indexed = array_combine( diff --git a/lib/Db/Provisioning.php b/lib/Db/Provisioning.php index b29afa91c..20eec71c5 100644 --- a/lib/Db/Provisioning.php +++ b/lib/Db/Provisioning.php @@ -28,6 +28,7 @@ namespace OCA\Mail\Db; use JsonSerializable; use OCP\AppFramework\Db\Entity; use OCP\IUser; +use ReturnTypeWillChange; /** * @method string getProvisioningDomain() @@ -97,9 +98,7 @@ class Provisioning extends Entity implements JsonSerializable { $this->addType('ldapAliasesProvisioning', 'boolean'); } - /** - * @return array - */ + #[ReturnTypeWillChange] public function jsonSerialize() { return [ 'id' => $this->getId(), diff --git a/lib/Db/Recipient.php b/lib/Db/Recipient.php index 5bfb276f8..14d46462e 100644 --- a/lib/Db/Recipient.php +++ b/lib/Db/Recipient.php @@ -28,6 +28,7 @@ namespace OCA\Mail\Db; use JsonSerializable; use OCP\AppFramework\Db\Entity; +use ReturnTypeWillChange; /** * @method int|null getMessageId() @@ -72,7 +73,8 @@ class Recipient extends Entity implements JsonSerializable { $this->addType('mailboxType', 'integer'); } - public function jsonSerialize(): array { + #[ReturnTypeWillChange] + public function jsonSerialize() { return [ 'id' => $this->getId(), 'messageId' => $this->getMessageId(), diff --git a/lib/Db/Tag.php b/lib/Db/Tag.php index fd32160f4..5a064d1a7 100644 --- a/lib/Db/Tag.php +++ b/lib/Db/Tag.php @@ -27,6 +27,7 @@ namespace OCA\Mail\Db; use JsonSerializable; use OCP\AppFramework\Db\Entity; +use ReturnTypeWillChange; /** * @method string getUserId() @@ -56,9 +57,8 @@ class Tag extends Entity implements JsonSerializable { public function __construct() { $this->addType('isDefaultTag', 'boolean'); } - /** - * @return array - */ + + #[ReturnTypeWillChange] public function jsonSerialize() { return [ 'id' => $this->getId(), diff --git a/lib/Db/TrustedSender.php b/lib/Db/TrustedSender.php index 3425c056a..3816b3fa0 100644 --- a/lib/Db/TrustedSender.php +++ b/lib/Db/TrustedSender.php @@ -27,6 +27,7 @@ namespace OCA\Mail\Db; use JsonSerializable; use OCP\AppFramework\Db\Entity; +use ReturnTypeWillChange; /** * @method setEmail(string $email): void @@ -47,6 +48,7 @@ class TrustedSender extends Entity implements JsonSerializable { /** @var string */ protected $type; + #[ReturnTypeWillChange] public function jsonSerialize() { return [ 'id' => $this->id, diff --git a/lib/IMAP/MailboxStats.php b/lib/IMAP/MailboxStats.php index 9af3c0452..0f66e2b48 100644 --- a/lib/IMAP/MailboxStats.php +++ b/lib/IMAP/MailboxStats.php @@ -27,6 +27,7 @@ declare(strict_types=1); namespace OCA\Mail\IMAP; use JsonSerializable; +use ReturnTypeWillChange; class MailboxStats implements JsonSerializable { @@ -55,6 +56,7 @@ class MailboxStats implements JsonSerializable { return $this->unread; } + #[ReturnTypeWillChange] public function jsonSerialize() { return [ 'total' => $this->total, diff --git a/lib/IMAP/Sync/Response.php b/lib/IMAP/Sync/Response.php index a1e47675b..271d81395 100644 --- a/lib/IMAP/Sync/Response.php +++ b/lib/IMAP/Sync/Response.php @@ -25,6 +25,7 @@ namespace OCA\Mail\IMAP\Sync; use JsonSerializable; use OCA\Mail\IMAP\MailboxStats; +use ReturnTypeWillChange; /** * @psalm-template T @@ -87,7 +88,8 @@ class Response implements JsonSerializable { return $this->stats; } - public function jsonSerialize(): array { + #[ReturnTypeWillChange] + public function jsonSerialize() { return [ 'newMessages' => $this->newMessages, 'changedMessages' => $this->changedMessages, diff --git a/lib/IMAP/Threading/DatabaseMessage.php b/lib/IMAP/Threading/DatabaseMessage.php index da79522ce..e158ac7cc 100644 --- a/lib/IMAP/Threading/DatabaseMessage.php +++ b/lib/IMAP/Threading/DatabaseMessage.php @@ -26,6 +26,7 @@ declare(strict_types=1); namespace OCA\Mail\IMAP\Threading; use JsonSerializable; +use ReturnTypeWillChange; use function array_map; use function array_merge; use function json_decode; @@ -104,7 +105,8 @@ class DatabaseMessage extends Message implements JsonSerializable { ); } - public function jsonSerialize(): array { + #[ReturnTypeWillChange] + public function jsonSerialize() { return array_merge( parent::jsonSerialize(), [ diff --git a/lib/IMAP/Threading/Message.php b/lib/IMAP/Threading/Message.php index 8fd7170ae..896606932 100644 --- a/lib/IMAP/Threading/Message.php +++ b/lib/IMAP/Threading/Message.php @@ -26,6 +26,7 @@ declare(strict_types=1); namespace OCA\Mail\IMAP\Threading; use JsonSerializable; +use ReturnTypeWillChange; use function str_replace; use function strpos; @@ -74,7 +75,8 @@ class Message implements JsonSerializable { return $this->references; } - public function jsonSerialize(): array { + #[ReturnTypeWillChange] + public function jsonSerialize() { return [ 'subject' => $this->subject, 'id' => $this->id, diff --git a/lib/Model/IMAPMessage.php b/lib/Model/IMAPMessage.php index 67dac0237..bc229c124 100644 --- a/lib/Model/IMAPMessage.php +++ b/lib/Model/IMAPMessage.php @@ -52,6 +52,7 @@ use OCA\Mail\Service\Html; use OCP\AppFramework\Db\DoesNotExistException; use OCP\Files\File; use OCP\Files\SimpleFS\ISimpleFile; +use ReturnTypeWillChange; use function fclose; use function in_array; use function mb_convert_encoding; @@ -494,10 +495,8 @@ class IMAPMessage implements IMessage, JsonSerializable { return $data; } - /** - * @return array - */ - public function jsonSerialize(): array { + #[ReturnTypeWillChange] + public function jsonSerialize() { return [ 'uid' => $this->getUid(), 'messageId' => $this->getMessageId(), diff --git a/lib/Service/Avatar/Avatar.php b/lib/Service/Avatar/Avatar.php index c8e11ff00..fafcbcc26 100644 --- a/lib/Service/Avatar/Avatar.php +++ b/lib/Service/Avatar/Avatar.php @@ -27,6 +27,7 @@ declare(strict_types=1); namespace OCA\Mail\Service\Avatar; use JsonSerializable; +use ReturnTypeWillChange; /** * @psalm-immutable @@ -76,10 +77,8 @@ class Avatar implements JsonSerializable { return $this->isExternal; } - /** - * @return array - */ - public function jsonSerialize(): array { + #[ReturnTypeWillChange] + public function jsonSerialize() { return [ 'isExternal' => $this->isExternal, 'mime' => $this->mime, diff --git a/lib/Service/Quota.php b/lib/Service/Quota.php index 2f23aa750..130cf6a85 100644 --- a/lib/Service/Quota.php +++ b/lib/Service/Quota.php @@ -26,6 +26,7 @@ declare(strict_types=1); namespace OCA\Mail\Service; use JsonSerializable; +use ReturnTypeWillChange; class Quota implements JsonSerializable { @@ -49,6 +50,7 @@ class Quota implements JsonSerializable { return $this->limit; } + #[ReturnTypeWillChange] public function jsonSerialize() { return [ 'usage' => $this->getUsage(), |