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

Breadcrumb

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

function ArrayAccessGetterSetter::set

Overrides PropagationSetterInterface::set

File

vendor/open-telemetry/context/Propagation/ArrayAccessGetterSetter.php, line 82

Class

ArrayAccessGetterSetter
Default implementation of {This type is used if no custom getter/setter is provided to {

Namespace

OpenTelemetry\Context\Propagation

Code

public function set(&$carrier, string $key, string $value) : void {
    if ($key === '') {
        throw new InvalidArgumentException('Unable to set value with an empty key');
    }
    if ($this->isSupportedCarrier($carrier)) {
        if (($r = $this->resolveKey($carrier, $key)) !== $key) {
            unset($carrier[$r]);
        }
        $carrier[$key] = $value;
        return;
    }
    throw new InvalidArgumentException(sprintf('Unsupported carrier type: %s. Unable to set value associated with key:%s', get_debug_type($carrier), $key));
}

API Navigation

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