diff options
Diffstat (limited to 'matrix-specification/Events/ClientEventWithoutRoomId.php')
-rw-r--r-- | matrix-specification/Events/ClientEventWithoutRoomId.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/matrix-specification/Events/ClientEventWithoutRoomId.php b/matrix-specification/Events/ClientEventWithoutRoomId.php new file mode 100644 index 0000000..0410d5b --- /dev/null +++ b/matrix-specification/Events/ClientEventWithoutRoomId.php @@ -0,0 +1,34 @@ +<?php + +namespace Matrix\Events; + +use Matrix\Enums\EventType; + +class ClientEventWithoutRoomId extends SenderEvent +{ + public function __construct( + array $content, + protected string $eventId, + protected int $originServerTimestamp, + string $sender, + protected string $stateKey, + EventType $type, + protected ?UnsignedData $unsigned = null, + ) + { + parent::__construct($content, $sender, $type); + } + + public function jsonSerialize(): array + { + return [ + "content" => $this->content ?: new \stdClass, + "event_id" => $this->eventId, + "origin_server_ts" => $this->originServerTimestamp, + "sender" => $this->sender, + "state_key" => $this->stateKey, + "type" => $this->type, + "unsigned" => $this->unsigned ?? new \stdClass, + ]; + } +} |