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