($option)
| 130 | } |
| 131 | |
| 132 | private function getCacheMetadata($option): array { |
| 133 | $currentCacheKey = 'json-' . (string)floor(time() / self::CACHE_TTL_SECONDS); |
| 134 | $clientCacheKey = isset($option['cacheKey']) ? trim((string)$option['cacheKey'], '"') : ''; |
| 135 | |
| 136 | return [ |
| 137 | 'cacheable' => true, |
| 138 | 'key' => $currentCacheKey, |
| 139 | 'notModified' => ($clientCacheKey !== '' && $clientCacheKey === $currentCacheKey), |
| 140 | ]; |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * Parses JSON data based on the provided options and raw input. |