diff options
Diffstat (limited to 'matrix-specification/Responses/ClientAccountWhoamiGetResponse.php')
| -rw-r--r-- | matrix-specification/Responses/ClientAccountWhoamiGetResponse.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/matrix-specification/Responses/ClientAccountWhoamiGetResponse.php b/matrix-specification/Responses/ClientAccountWhoamiGetResponse.php new file mode 100644 index 0000000..2f7ff81 --- /dev/null +++ b/matrix-specification/Responses/ClientAccountWhoamiGetResponse.php @@ -0,0 +1,24 @@ +<?php + +namespace Matrix\Responses; + +use Matrix\Response; + +class ClientAccountWhoamiGetResponse extends Response +{ + public function __construct( + private string $userId, + private ?string $deviceId = null, + private ?bool $isGuest = null, + ) + {} + + public function getBody(): array + { + return array_filter([ + "device_id" => $this->deviceId, + "is_guest" => $this->isGuest, + "user_id" => $this->userId, + ], fn ($value) => ! is_null($value)); + } +} |
