$record */ public function __construct(array $record) { $this->confidence = $record['confidence'] ?? null; $this->networkLastSeen = $record['network_last_seen'] ?? null; $this->providerName = $record['provider_name'] ?? null; } /** * @return array */ public function jsonSerialize(): array { $js = []; if ($this->confidence !== null) { $js['confidence'] = $this->confidence; } if ($this->networkLastSeen !== null) { $js['network_last_seen'] = $this->networkLastSeen; } if ($this->providerName !== null) { $js['provider_name'] = $this->providerName; } return $js; } }