Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PsrUtils.php

function PsrUtils::decode

@psalm-suppress InvalidArrayOffset

Parameters

list<string> $encodings:

1 call to PsrUtils::decode()
PsrTransport::send in vendor/open-telemetry/sdk/Common/Export/Http/PsrTransport.php
@psalm-suppress ArgumentTypeCoercion

File

vendor/open-telemetry/sdk/Common/Export/Http/PsrUtils.php, line 92

Class

PsrUtils
@internal

Namespace

OpenTelemetry\SDK\Common\Export\Http

Code

public static function decode(string $value, array $encodings) : string {
    if ($value === '') {
        return $value;
    }
    for ($i = count($encodings); --$i >= 0;) {
        if (strcasecmp($encodings[$i], 'identity') === 0) {
            continue;
        }
        if (!($decoder = self::decoder($encodings[$i]))) {
            throw new UnexpectedValueException(sprintf('Not supported decompression encoding "%s"', $encodings[$i]));
        }
        $value = $decoder($value);
    }
    return $value;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal