| 250 | } |
| 251 | |
| 252 | private function getCacheMetadata($option): array { |
| 253 | $currentCacheKey = 'gh-' . (string)floor(time() / self::CACHE_TTL_SECONDS); |
| 254 | $clientCacheKey = isset($option['cacheKey']) ? trim((string)$option['cacheKey'], '"') : ''; |
| 255 | |
| 256 | return [ |
| 257 | 'cacheable' => true, |
| 258 | 'key' => $currentCacheKey, |
| 259 | 'notModified' => ($clientCacheKey !== '' && $clientCacheKey === $currentCacheKey), |
| 260 | ]; |
| 261 | } |
| 262 | |
| 263 | private function buildHttpErrorResult(int $httpCode, array $curlResult, array $cache): array { |
| 264 | return [ |