Make Lookup/{Response,Producer} compatible to /nodes endpoint

This commit is contained in:
2021-09-13 23:47:20 +03:00
parent 65adecde3f
commit 6428a1ec33
2 changed files with 5 additions and 1 deletions

View File

@ -13,6 +13,8 @@ final class Producer
public int $tcpPort, public int $tcpPort,
public int $httpPort, public int $httpPort,
public string $version, public string $version,
public array $tombstones,
public array $topics,
) { ) {
} }
@ -25,6 +27,8 @@ final class Producer
$array['tcp_port'], $array['tcp_port'],
$array['http_port'], $array['http_port'],
$array['version'], $array['version'],
$array['tombstones'] ?? [],
$array['topics'] ?? [],
); );
} }
} }

View File

@ -27,7 +27,7 @@ final class Response
} }
return new self( return new self(
$array['channels'], $array['channels'] ?? [],
array_map([Producer::class, 'fromArray'], $array['producers']), array_map([Producer::class, 'fromArray'], $array['producers']),
); );
} }