function PsrUtils::encoder
1 call to PsrUtils::encoder()
- PsrUtils::encode in vendor/
open-telemetry/ sdk/ Common/ Export/ Http/ PsrUtils.php
File
-
vendor/
open-telemetry/ sdk/ Common/ Export/ Http/ PsrUtils.php, line 130
Class
- PsrUtils
- @internal
Namespace
OpenTelemetry\SDK\Common\Export\HttpCode
private static function encoder(string $encoding) : ?callable {
static $encoders;
/** @noinspection SpellCheckingInspection */
$encoders ??= array_map(fn(callable $callable): callable => self::throwOnErrorOrFalse($callable), array_filter([
TransportFactoryInterface::COMPRESSION_GZIP => 'gzencode',
TransportFactoryInterface::COMPRESSION_DEFLATE => 'gzcompress',
TransportFactoryInterface::COMPRESSION_BROTLI => 'brotli_compress',
], 'function_exists'));
return $encoders[$encoding] ?? null;
}