summaryrefslogtreecommitdiff
path: root/matrix-specification/Data/Room/UnreadNotificationCounts.php
blob: f00a6a5f4c2138618f662cd8ce9c83291ffc176d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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,
    ], fn ($value) => ! is_null($value));
  }
}