fqdn => record_id */ public array $records = []; public bool $failUpsert = false; private int $counter = 1; public function upsertRecord(string $fqdn, string $type, string $value): string { if ($this->failUpsert) { throw new RuntimeException('hetzner dns 5xx'); } return $this->records[$fqdn] ??= 'rec-'.$this->counter++; } public function deleteRecord(string $recordId): void { $this->records = array_filter($this->records, fn ($id) => $id !== $recordId); } }