> $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 ?? [], ), fn ($value) => ! is_null($value) ); } }