function PsrUtils::decoder
1 call to PsrUtils::decoder()
- PsrUtils::decode in vendor/
open-telemetry/ sdk/ Common/ Export/ Http/ PsrUtils.php - @psalm-suppress InvalidArrayOffset
File
-
vendor/
open-telemetry/ sdk/ Common/ Export/ Http/ PsrUtils.php, line 144
Class
- PsrUtils
- @internal
Namespace
OpenTelemetry\SDK\Common\Export\HttpCode
private static function decoder(string $encoding) : ?callable {
static $decoders;
/** @noinspection SpellCheckingInspection */
$decoders ??= array_map(fn(callable $callable): callable => self::throwOnErrorOrFalse($callable), array_filter([
TransportFactoryInterface::COMPRESSION_GZIP => 'gzdecode',
TransportFactoryInterface::COMPRESSION_DEFLATE => 'gzuncompress',
TransportFactoryInterface::COMPRESSION_BROTLI => 'brotli_uncompress',
], 'function_exists'));
return $decoders[$encoding] ?? null;
}