diff options
| author | Daniel Weipert <git@mail.dweipert.de> | 2025-09-19 17:03:47 +0200 |
|---|---|---|
| committer | Daniel Weipert <git@mail.dweipert.de> | 2025-09-19 17:03:47 +0200 |
| commit | b08047ba485f86038f33175162943c0a9878ab1a (patch) | |
| tree | 49980e78eb3e641b04ddcc0817f74e89dc07f2b7 /matrix-specification/Events/UnsignedData.php | |
| parent | 2ae0c2fa2a0bb5a7cd1fd9da1c6d2a6090126e67 (diff) | |
Diffstat (limited to 'matrix-specification/Events/UnsignedData.php')
| -rw-r--r-- | matrix-specification/Events/UnsignedData.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/matrix-specification/Events/UnsignedData.php b/matrix-specification/Events/UnsignedData.php new file mode 100644 index 0000000..924af29 --- /dev/null +++ b/matrix-specification/Events/UnsignedData.php @@ -0,0 +1,31 @@ +<?php + +namespace Matrix\Events; + +use Matrix\Enums\MembershipState; + +/** + * @see https://spec.matrix.org/v1.16/client-server-api/#definition-clientevent_unsigneddata + */ +class UnsignedData implements \JsonSerializable +{ + public function __construct( + private ?int $age = null, + private ?MembershipState $membership = null, + private ?array $previousContent = null, + private ?ClientEvent $redactedBecause = null, + private ?string $transactionId = null, + ) + {} + + public function jsonSerialize(): array + { + return array_filter([ + "age" => $this->age, + "membership" => $this->membership, + "prev_content" => $this->previousContent, + "redacted_because" => $this->redactedBecause, + "transaction_id" => $this->transactionId, + ], "is_null"); + } +} |
