summaryrefslogtreecommitdiff
path: root/matrix-specification/Data/Room/ThreadNotificationCounts.php
blob: 602de61b1bb6c7ecf35157d32ca6209af6da45d4 (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 ThreadNotificationCounts 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));
  }
}