From b08047ba485f86038f33175162943c0a9878ab1a Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 19 Sep 2025 17:03:47 +0200 Subject: add separate matrix specification package --- .../Requests/ClientLoginGetRequest.php | 6 +++ .../Requests/ClientLoginPostRequest.php | 53 ++++++++++++++++++++++ .../Requests/ClientSyncGetRequest.php | 8 ++++ matrix-specification/Requests/RateLimited.php | 8 ++++ .../Requests/RequiresAuthentication.php | 8 ++++ 5 files changed, 83 insertions(+) create mode 100644 matrix-specification/Requests/ClientLoginGetRequest.php create mode 100644 matrix-specification/Requests/ClientLoginPostRequest.php create mode 100644 matrix-specification/Requests/ClientSyncGetRequest.php create mode 100644 matrix-specification/Requests/RateLimited.php create mode 100644 matrix-specification/Requests/RequiresAuthentication.php (limited to 'matrix-specification/Requests') diff --git a/matrix-specification/Requests/ClientLoginGetRequest.php b/matrix-specification/Requests/ClientLoginGetRequest.php new file mode 100644 index 0000000..73cc24c --- /dev/null +++ b/matrix-specification/Requests/ClientLoginGetRequest.php @@ -0,0 +1,6 @@ + $this->deviceId, + "identifier" => $this->identifier, + "initial_device_display_name" => $this->initialDeviceDisplayName, + "refresh_token" => $this->refreshToken, + "type" => $this->type, + ]; + + $request += match ($this->type) { + LoginType::PASSWORD => [ + "password" => $this->password, + ], + + LoginType::TOKEN => [ + "token" => $this->token, + ], + + default => [], + }; + + return array_filter($request, "is_null"); + } +} diff --git a/matrix-specification/Requests/ClientSyncGetRequest.php b/matrix-specification/Requests/ClientSyncGetRequest.php new file mode 100644 index 0000000..2921fcf --- /dev/null +++ b/matrix-specification/Requests/ClientSyncGetRequest.php @@ -0,0 +1,8 @@ +