summaryrefslogtreecommitdiff
path: root/matrix-specification/Responses/ClientUserIdFilterPostResponse.php
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2025-09-25 13:38:24 +0200
committerDaniel Weipert <git@mail.dweipert.de>2025-09-25 13:38:24 +0200
commitb19a8f63ad727a3633885d3f2b81edf8181a53b9 (patch)
tree6b5fd70224a125a16010a291e5fd0df834e9436f /matrix-specification/Responses/ClientUserIdFilterPostResponse.php
parentb08047ba485f86038f33175162943c0a9878ab1a (diff)
matrix-specification split work in progress
Diffstat (limited to 'matrix-specification/Responses/ClientUserIdFilterPostResponse.php')
-rw-r--r--matrix-specification/Responses/ClientUserIdFilterPostResponse.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/matrix-specification/Responses/ClientUserIdFilterPostResponse.php b/matrix-specification/Responses/ClientUserIdFilterPostResponse.php
new file mode 100644
index 0000000..ed7ba37
--- /dev/null
+++ b/matrix-specification/Responses/ClientUserIdFilterPostResponse.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Matrix\Responses;
+
+class ClientUserIdFilterPostResponse implements \JsonSerializable
+{
+ public function __construct(
+ private string $filterId,
+ )
+ {
+ if (str_starts_with($filterId, "{")) {
+ throw new \InvalidArgumentException("filterId cannot start with a { as this character is used to determine if the filter provided is inline JSON or a previously declared filter by homeservers on some APIs");
+ }
+ }
+
+ public function jsonSerialize(): array
+ {
+ return [
+ "filter_id" => $this->filterId,
+ ];
+ }
+}