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

Breadcrumb

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

function PsrUtils::encode

Parameters

list<string> $encodings:

array<int, string>|null $appliedEncodings:

1 call to PsrUtils::encode()
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 67

Class

PsrUtils
@internal

Namespace

OpenTelemetry\SDK\Common\Export\Http

Code

public static function encode(string $value, array $encodings, ?array &$appliedEncodings = null) : string {
    for ($i = 0, $n = count($encodings); $i < $n; $i++) {
        if (!($encoder = self::encoder($encodings[$i]))) {
            unset($encodings[$i]);
            continue;
        }
        try {
            $value = $encoder($value);
        } catch (Throwable) {
            unset($encodings[$i]);
        }
    }
    $appliedEncodings = $encodings;
    return $value;
}

API Navigation

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