$raw */ public function __construct(array $raw) { $this->connectionType = $raw['connection_type'] ?? 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->connectionType !== null) { $js['connection_type'] = $this->connectionType; } $js['ip_address'] = $this->ipAddress; $js['network'] = $this->network; return $js; } }