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

Breadcrumb

  1. Drupal Core 11.1.x

LateBindingTextMapPropagator.php

Namespace

OpenTelemetry\SDK\Propagation

File

vendor/open-telemetry/sdk/Propagation/LateBindingTextMapPropagator.php

View source
<?php

declare (strict_types=1);
namespace OpenTelemetry\SDK\Propagation;

use Closure;
use OpenTelemetry\Context\ContextInterface;
use OpenTelemetry\Context\Propagation\PropagationGetterInterface;
use OpenTelemetry\Context\Propagation\PropagationSetterInterface;
use OpenTelemetry\Context\Propagation\TextMapPropagatorInterface;

/**
 * @internal
 */
final class LateBindingTextMapPropagator implements TextMapPropagatorInterface {
    
    /**
     * @param TextMapPropagatorInterface|Closure(): TextMapPropagatorInterface $propagator
     */
    public function __construct(TextMapPropagatorInterface|Closure $propagator) {
    }
    public function fields() : array {
        if (!$this->propagator instanceof TextMapPropagatorInterface) {
            $this->propagator = ($this->propagator)();
        }
        return $this->propagator
            ->fields();
    }
    public function inject(mixed &$carrier, ?PropagationSetterInterface $setter = null, ?ContextInterface $context = null) : void {
        if (!$this->propagator instanceof TextMapPropagatorInterface) {
            $this->propagator = ($this->propagator)();
        }
        $this->propagator
            ->inject($carrier, $setter, $context);
    }
    public function extract($carrier, ?PropagationGetterInterface $getter = null, ?ContextInterface $context = null) : ContextInterface {
        if (!$this->propagator instanceof TextMapPropagatorInterface) {
            $this->propagator = ($this->propagator)();
        }
        return $this->propagator
            ->extract($carrier, $getter, $context);
    }

}

Classes

Title Deprecated Summary
LateBindingTextMapPropagator @internal

API Navigation

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