diff options
| author | Daniel Weipert <git@mail.dweipert.de> | 2025-09-25 13:38:24 +0200 |
|---|---|---|
| committer | Daniel Weipert <git@mail.dweipert.de> | 2025-09-25 13:38:24 +0200 |
| commit | b19a8f63ad727a3633885d3f2b81edf8181a53b9 (patch) | |
| tree | 6b5fd70224a125a16010a291e5fd0df834e9436f /matrix-specification/Data/Room/Rooms.php | |
| parent | b08047ba485f86038f33175162943c0a9878ab1a (diff) | |
matrix-specification split work in progress
Diffstat (limited to 'matrix-specification/Data/Room/Rooms.php')
| -rw-r--r-- | matrix-specification/Data/Room/Rooms.php | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/matrix-specification/Data/Room/Rooms.php b/matrix-specification/Data/Room/Rooms.php new file mode 100644 index 0000000..1a84608 --- /dev/null +++ b/matrix-specification/Data/Room/Rooms.php @@ -0,0 +1,62 @@ +<?php + +namespace Matrix\Data\Room; + +class Rooms implements \JsonSerializable +{ + /** + * @param array<string, InvitedRoom> $invite + * @param array<string, JoinedRoom> $join + * @param array<string, KnockedRoom> $knock + * @param array<string, LeftRoom> $leave + */ + public function __construct( + private ?array $invite = null, + private ?array $join = null, + private ?array $knock = null, + private ?array $leave = null, + ) + {} + + public function jsonSerialize(): array + { + return [ + "invite" => $this->invite ?? new \stdClass(), + "join" => $this->join ?? new \stdClass(), + "knock" => $this->knock ?? new \stdClass(), + "leave" => $this->leave ?? new \stdClass(), + ]; + } + + /** + * @return InvitedRoom[] + */ + public function getInvite(): ?array + { + return $this->invite; + } + + /** + * @return JoinedRoom[] + */ + public function getJoined(): ?array + { + return $this->join; + } + + /** + * @return KnockedRoom[] + */ + public function getKnocked(): ?array + { + return $this->knock; + } + + /** + * @return LeftRoom[] + */ + public function getLeft(): ?array + { + return $this->leave; + } +} |
