blob: 42a3dc248085e5a97f772bc30b97b434709b5068 (
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
|
<?php
namespace Matrix\Data;
class DiscoveryInformation implements \JsonSerializable
{
/**
* @param array<string, array<mixed, mixed>> $otherProperties
*/
public function __construct(
private HomeServerInformation $homeServerInformation,
private IdentityServerInformation $identityServerInformation,
private ?array $otherProperties = null,
)
{}
public function jsonSerialize(): array
{
return array_filter(
array_merge(
[
"m.homeserver" => $this->homeServerInformation,
"m.identity_server" => $this->identityServerInformation,
],
$this->otherProperties ?? [],
),
"is_null"
);
}
}
|