summaryrefslogtreecommitdiff
path: root/matrix-specification/Events/Event.php
blob: 5b3e450c7e587aaebf4058c84404bbcd7afead84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

namespace Matrix\Events;

use Matrix\Enums\EventType;

abstract class Event implements \JsonSerializable
{
  /**
   * @param array<string, mixed> $content
   */
  public function __construct(
    protected array $content,
    protected EventType $type,
  )
  {}

  /**
   * @return array<string, mixed>
   */
  public function getContent(): array
  {
    return $this->content;
  }

  public function getType(): EventType
  {
    return $this->type;
  }
}