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

Method parseHeaders

lib/Datasource/ExternalJson.php:119–129  ·  view source on GitHub ↗

@return array */

(string $customHeaders)

Source from the content-addressed store, hash-verified

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);

Callers 1

readDataMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected