diff options
| author | Daniel Weipert <git@mail.dweipert.de> | 2025-09-25 13:38:24 +0200 |
|---|---|---|
| committer | Daniel Weipert <git@mail.dweipert.de> | 2025-09-25 13:38:24 +0200 |
| commit | b19a8f63ad727a3633885d3f2b81edf8181a53b9 (patch) | |
| tree | 6b5fd70224a125a16010a291e5fd0df834e9436f /matrix-specification/Responses/ClientSyncGetResponse.php | |
| parent | b08047ba485f86038f33175162943c0a9878ab1a (diff) | |
matrix-specification split work in progress
Diffstat (limited to 'matrix-specification/Responses/ClientSyncGetResponse.php')
| -rw-r--r-- | matrix-specification/Responses/ClientSyncGetResponse.php | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/matrix-specification/Responses/ClientSyncGetResponse.php b/matrix-specification/Responses/ClientSyncGetResponse.php index 27464c1..ccdc5e6 100644 --- a/matrix-specification/Responses/ClientSyncGetResponse.php +++ b/matrix-specification/Responses/ClientSyncGetResponse.php @@ -2,7 +2,38 @@ namespace Matrix\Responses; -class ClientSyncGetResponse +use Matrix\Data\AccountData; +use Matrix\Data\DeviceLists; +use Matrix\Data\Presence; +use Matrix\Data\Room\Rooms; +use Matrix\Data\ToDevice; + +class ClientSyncGetResponse implements \JsonSerializable { - # TODO + /** + * @param array<string, int> $deviceOneTimeKeysCount + */ + public function __construct( + private string $nextBatch, + private ?AccountData $accountData = null, + private ?DeviceLists $deviceLists = null, + private ?array $deviceOneTimeKeysCount = null, + private ?Presence $presence = null, + private ?Rooms $rooms = null, + private ?ToDevice $toDevice = null, + ) + {} + + public function jsonSerialize(): array + { + return array_filter([ + "account_data" => $this->accountData, + "device_lists" => $this->deviceLists, + "device_one_time_keys_count" => $this->deviceOneTimeKeysCount, + "next_batch" => $this->nextBatch, + "presence" => $this->presence, + "rooms" => $this->rooms, + "to_device" => $this->toDevice, + ], "is_null"); + } } |
