MCPcopy Create free account
hub / github.com/Rello/analytics / getCacheMetadata

Method getCacheMetadata

lib/Datasource/ExternalJson.php:137–146  ·  view source on GitHub ↗
($option)

Source from the content-addressed store, hash-verified

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

Callers 1

readDataMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected