appConfig->getValueString(Application::APP_ID, $this->key($repositoryId), '', true); $data = $raw === '' ? null : json_decode($raw, true); return is_array($data) && isset($data['gen'], $data['hash']) ? ['gen' => (int)$data['gen'], 'hash' => (string)$data['hash']] : null; } public function set(string $repositoryId, int $gen, string $hash): void { $this->appConfig->setValueString(Application::APP_ID, $this->key($repositoryId), json_encode(['gen' => $gen, 'hash' => $hash]), true); } private function key(string $repositoryId): string { return 'catalog_' . preg_replace('/[^a-f0-9]/', '', $repositoryId); } }