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