@return array */
(string $customHeaders)
| 117 | |
| 118 | /** @return array<string, string> */ |
| 119 | private function parseHeaders(string $customHeaders): array { |
| 120 | $headers = []; |
| 121 | foreach (explode(',', $customHeaders) as $header) { |
| 122 | if (trim($header) === '') { |
| 123 | continue; |
| 124 | } |
| 125 | [$name, $value] = array_pad(explode(':', $header, 2), 2, ''); |
| 126 | $headers[trim($name)] = trim($value); |
| 127 | } |
| 128 | return $headers; |
| 129 | } |
| 130 | |
| 131 | private function getCacheMetadata($option): array { |
| 132 | $currentCacheKey = 'json-' . (string)floor(time() / self::CACHE_TTL_SECONDS); |