summaryrefslogtreecommitdiff
path: root/matrix-specification/Data/Room/UnreadNotificationCounts.php
diff options
context:
space:
mode:
Diffstat (limited to 'matrix-specification/Data/Room/UnreadNotificationCounts.php')
-rw-r--r--matrix-specification/Data/Room/UnreadNotificationCounts.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/matrix-specification/Data/Room/UnreadNotificationCounts.php b/matrix-specification/Data/Room/UnreadNotificationCounts.php
new file mode 100644
index 0000000..d2600e6
--- /dev/null
+++ b/matrix-specification/Data/Room/UnreadNotificationCounts.php
@@ -0,0 +1,20 @@
+<?php
+
+namespace Matrix\Data\Room;
+
+class UnreadNotificationCounts implements \JsonSerializable
+{
+ public function __construct(
+ private ?int $highlightCount = null,
+ private ?int $notificationCount = null,
+ )
+ {}
+
+ public function jsonSerialize(): array
+ {
+ return array_filter([
+ "highlight_count" => $this->highlightCount,
+ "notification_count" => $this->notificationCount,
+ ], "is_null");
+ }
+}