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)); } }