From 2386148b8f048ba40d9f26cc97898bdcdc778ea2 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sat, 13 Dec 2025 16:27:53 +0100 Subject: matrix specification split --- .../Requests/ClientRegisterPostRequest.php | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 matrix-specification/Requests/ClientRegisterPostRequest.php (limited to 'matrix-specification/Requests/ClientRegisterPostRequest.php') diff --git a/matrix-specification/Requests/ClientRegisterPostRequest.php b/matrix-specification/Requests/ClientRegisterPostRequest.php new file mode 100644 index 0000000..74c0c1d --- /dev/null +++ b/matrix-specification/Requests/ClientRegisterPostRequest.php @@ -0,0 +1,57 @@ +kind ??= UserRegistrationKind::USER; + $this->inhibitLogin ??= false; + } + + public function getUri(string $scheme, string $serverName, ApiPathVersion $version): string + { + return "{$scheme}://{$serverName}/_matrix/client/{$version}/register"; + } + + public function getQueryParameters(): array + { + return array_filter([ + "kind" => $this->kind, + ], fn ($value) => ! is_null($value)); + } + + public function getBody(): array + { + return array_filter([ + "auth" => $this->authenticationData, + "device_id" => $this->deviceId, + "inhibit_login" => $this->inhibitLogin, + "initial_device_display_name" => $this->initialDeviceDisplayName, + "password" => $this->password, + "refresh_token" => $this->refreshToken, + "username" => $this->username, + ], fn ($value) => ! is_null($value)); + } +} -- cgit v1.2.3