summaryrefslogtreecommitdiff
path: root/matrix-specification/Responses/ClientRefreshPostResponse.php
diff options
context:
space:
mode:
Diffstat (limited to 'matrix-specification/Responses/ClientRefreshPostResponse.php')
-rw-r--r--matrix-specification/Responses/ClientRefreshPostResponse.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/matrix-specification/Responses/ClientRefreshPostResponse.php b/matrix-specification/Responses/ClientRefreshPostResponse.php
new file mode 100644
index 0000000..b1e1154
--- /dev/null
+++ b/matrix-specification/Responses/ClientRefreshPostResponse.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Matrix\Responses;
+
+class ClientRefreshPostResponse implements \JsonSerializable
+{
+ public function __construct(
+ private string $accessToken,
+ private ?int $expiresInMilliseconds = null,
+ private ?string $refreshToken = null,
+ )
+ {}
+
+ public function jsonSerialize(): array
+ {
+ return array_filter([
+ "access_token" => $this->accessToken,
+ "expires_in_ms" => $this->expiresInMilliseconds,
+ "refresh_token" => $this->refreshToken,
+ ], "is_null");
+ }
+}