summaryrefslogtreecommitdiff
path: root/matrix-specification/Responses/ClientAccountWhoamiGetResponse.php
diff options
context:
space:
mode:
Diffstat (limited to 'matrix-specification/Responses/ClientAccountWhoamiGetResponse.php')
-rw-r--r--matrix-specification/Responses/ClientAccountWhoamiGetResponse.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/matrix-specification/Responses/ClientAccountWhoamiGetResponse.php b/matrix-specification/Responses/ClientAccountWhoamiGetResponse.php
new file mode 100644
index 0000000..48fbbde
--- /dev/null
+++ b/matrix-specification/Responses/ClientAccountWhoamiGetResponse.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Matrix\Responses;
+
+class ClientAccountWhoamiGetResponse implements \JsonSerializable
+{
+ public function __construct(
+ private string $userId,
+ private ?string $deviceId = null,
+ private ?bool $isGuest = null,
+ )
+ {}
+
+ public function jsonSerialize(): array
+ {
+ return array_filter([
+ "device_id" => $this->deviceId,
+ "is_guest" => $this->isGuest,
+ "user_id" => $this->userId,
+ ], "is_null");
+ }
+}