diff options
Diffstat (limited to 'matrix-specification/Responses/ClientVersionsGetResponse.php')
| -rw-r--r-- | matrix-specification/Responses/ClientVersionsGetResponse.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/matrix-specification/Responses/ClientVersionsGetResponse.php b/matrix-specification/Responses/ClientVersionsGetResponse.php new file mode 100644 index 0000000..9ec701d --- /dev/null +++ b/matrix-specification/Responses/ClientVersionsGetResponse.php @@ -0,0 +1,24 @@ +<?php + +namespace Matrix\Responses; + +class ClientVersionsGetResponse implements \JsonSerializable +{ + /** + * @param string[] $versions + * @param array<string, bool> $unstableFeatures + */ + public function __construct( + private array $versions, + private ?array $unstableFeatures = null, + ) + {} + + public function jsonSerialize(): array + { + return array_filter([ + "unstable_features" => $this->unstableFeatures, + "versions" => $this->versions, + ], "is_null"); + } +} |
