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
This commit is contained in:
Tim Düsterhus 2022-10-13 12:59:04 +02:00
parent 7d7bf89dcc
commit 845788583d
Signed by: TimWolla
GPG Key ID: 8FF75566094168AF
5 changed files with 9 additions and 9 deletions

View File

@ -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.

View File

@ -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,

View File

@ -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(),

View File

@ -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,

View File

@ -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,