| 263 | } |
| 264 | |
| 265 | private function getCacheMetadata($option): array { |
| 266 | $currentCacheKey = 'gh-' . (string)floor(time() / self::CACHE_TTL_SECONDS); |
| 267 | $clientCacheKey = isset($option['cacheKey']) ? trim((string)$option['cacheKey'], '"') : ''; |
| 268 | |
| 269 | return [ |
| 270 | 'cacheable' => true, |
| 271 | 'key' => $currentCacheKey, |
| 272 | 'notModified' => ($clientCacheKey !== '' && $clientCacheKey === $currentCacheKey), |
| 273 | ]; |
| 274 | } |
| 275 | |
| 276 | private function buildHttpErrorResult(int $httpCode, array $curlResult, array $cache): array { |
| 277 | return [ |