summaryrefslogtreecommitdiff
path: root/src/Events/RoomNameEvent.php
blob: 59abbe24dc393b54507449d84d1e445ebea5af38 (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
31
32
33
<?php

namespace App\Events;

use App\Types\EventType;

class RoomNameEvent extends Event
{
  public function __construct(
    private string $sender,
    private string $stateKey,
    private string $name,
  )
  {
    parent::__construct(EventType::ROOM_NAME);
  }

  public function fromJson(string $json): static
  {
  }

  public function toJsonEncodeable(): array
  {
    return [
      "type" => $this->type,
      "sender" => $this->sender,
      "state_key" => $this->stateKey,
      "content" => [
        "name" => $this->name,
      ],
    ];
  }
}