*/ private array $statuses = []; public function markAsTesting(int $sourceId): void { $this->statuses[$sourceId] = ['status' => 'testing', 'testedAt' => null, 'error' => null]; } public function markAsHealthy(int $sourceId, \DateTimeImmutable $testedAt): void { $this->statuses[$sourceId] = ['status' => 'ok', 'testedAt' => $testedAt, 'error' => null]; } public function markAsUnhealthy(int $sourceId, \DateTimeImmutable $testedAt, string $error): void { $this->statuses[$sourceId] = ['status' => 'ko', 'testedAt' => $testedAt, 'error' => $error]; } public function getStatus(int $sourceId): ?string { return $this->statuses[$sourceId]['status'] ?? null; } public function getError(int $sourceId): ?string { return $this->statuses[$sourceId]['error'] ?? null; } public function clear(): void { $this->statuses = []; } }