From 845788583d5ebdb0dbc240fa60d5597b4cd19a25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 13 Oct 2022 12:59:04 +0200 Subject: [PATCH] Add return types to `jsonSerialize()` > During inheritance of JsonSerializable: Uncaught > wcf\system\exception\ErrorException: Return type of > chat\data\room\Room::jsonSerialize() should either be compatible with > JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] > attribute should be used to temporarily suppress the notice --- LICENSE | 2 +- files/lib/data/message/ViewableMessage.class.php | 4 ++-- files/lib/data/room/Room.class.php | 4 ++-- files/lib/data/suspension/Suspension.class.php | 4 ++-- files/lib/data/user/User.class.php | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/LICENSE b/LICENSE index cf8c1f7..f06993c 100644 --- a/LICENSE +++ b/LICENSE @@ -10,7 +10,7 @@ Additional Use Grant: You may use the Licensed Work when your application uses the Licensed Work for a purpose that does neither directly or indirectly generate revenue. -Change Date: 2026-09-19 +Change Date: 2026-10-13 Change License: Version 2 or later of the GNU General Public License as published by the Free Software Foundation. diff --git a/files/lib/data/message/ViewableMessage.class.php b/files/lib/data/message/ViewableMessage.class.php index 74a9e9e..1891fb3 100644 --- a/files/lib/data/message/ViewableMessage.class.php +++ b/files/lib/data/message/ViewableMessage.class.php @@ -6,7 +6,7 @@ * Use of this software is governed by the Business Source License * included in the LICENSE file. * - * Change Date: 2026-09-17 + * Change Date: 2026-10-13 * * On the date above, in accordance with the Business Source * License, use of this software will be governed by version 2 @@ -40,7 +40,7 @@ class ViewableMessage extends DatabaseObjectDecorator implements \JsonSerializab /** * @inheritDoc */ - public function jsonSerialize() + public function jsonSerialize(): array { $link = LinkHandler::getInstance()->getControllerLink( LogPage::class, diff --git a/files/lib/data/room/Room.class.php b/files/lib/data/room/Room.class.php index a84722d..a028d2a 100644 --- a/files/lib/data/room/Room.class.php +++ b/files/lib/data/room/Room.class.php @@ -6,7 +6,7 @@ * Use of this software is governed by the Business Source License * included in the LICENSE file. * - * Change Date: 2026-09-17 + * Change Date: 2026-10-13 * * On the date above, in accordance with the Business Source * License, use of this software will be governed by version 2 @@ -294,7 +294,7 @@ final class Room extends DatabaseObject implements /** * @inheritDoc */ - public function jsonSerialize() + public function jsonSerialize(): array { return [ 'title' => $this->getTitle(), diff --git a/files/lib/data/suspension/Suspension.class.php b/files/lib/data/suspension/Suspension.class.php index 35c30ab..09b8850 100644 --- a/files/lib/data/suspension/Suspension.class.php +++ b/files/lib/data/suspension/Suspension.class.php @@ -6,7 +6,7 @@ * Use of this software is governed by the Business Source License * included in the LICENSE file. * - * Change Date: 2026-09-17 + * Change Date: 2026-10-13 * * On the date above, in accordance with the Business Source * License, use of this software will be governed by version 3 @@ -102,7 +102,7 @@ class Suspension extends DatabaseObject implements \JsonSerializable /** * @inheritDoc */ - public function jsonSerialize() + public function jsonSerialize(): array { return [ 'userID' => $this->userID, diff --git a/files/lib/data/user/User.class.php b/files/lib/data/user/User.class.php index d08d19a..b764bbb 100644 --- a/files/lib/data/user/User.class.php +++ b/files/lib/data/user/User.class.php @@ -6,7 +6,7 @@ * Use of this software is governed by the Business Source License * included in the LICENSE file. * - * Change Date: 2026-09-17 + * Change Date: 2026-10-13 * * On the date above, in accordance with the Business Source * License, use of this software will be governed by version 2 @@ -110,7 +110,7 @@ class User extends DatabaseObjectDecorator implements \JsonSerializable /** * @inheritDoc */ - public function jsonSerialize() + public function jsonSerialize(): array { return [ 'userID' => $this->userID,