$raw */ public function __construct(array $raw) { $this->domain = $raw['domain'] ?? null; $ipAddress = $raw['ip_address']; $this->ipAddress = $ipAddress; $this->network = Util::cidr($ipAddress, $raw['prefix_len']); } /** * @return array|null */ public function jsonSerialize(): ?array { $js = []; if ($this->domain !== null) { $js['domain'] = $this->domain; } $js['ip_address'] = $this->ipAddress; $js['network'] = $this->network; return $js; } }