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

Breadcrumb

  1. Drupal Core 11.1.x

BaggageBuilder.php

Namespace

OpenTelemetry\API\Baggage

File

vendor/open-telemetry/api/Baggage/BaggageBuilder.php

View source
<?php

declare (strict_types=1);
namespace OpenTelemetry\API\Baggage;

final class BaggageBuilder implements BaggageBuilderInterface {
    
    /** @param array<string, Entry> $entries */
    public function __construct(array $entries = []) {
    }
    
    /** @inheritDoc */
    public function remove(string $key) : BaggageBuilderInterface {
        unset($this->entries[$key]);
        return $this;
    }
    
    /** @inheritDoc */
    public function set(string $key, $value, ?MetadataInterface $metadata = null) : BaggageBuilderInterface {
        $metadata ??= Metadata::getEmpty();
        $this->entries[$key] = new Entry($value, $metadata);
        return $this;
    }
    public function build() : BaggageInterface {
        return new Baggage($this->entries);
    }

}

Classes

Title Deprecated Summary
BaggageBuilder

API Navigation

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