summaryrefslogtreecommitdiff
path: root/matrix-specification/Data/Room/UnreadNotificationCounts.php
blob: d2600e6e4511958dc34b5f3c5d0ebe5c89d4482b (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,
    ], "is_null");
  }
}