OpenTelemetry PHP

Baggage
in package
implements BaggageInterface

FinalYes

Table of Contents

Interfaces

BaggageInterface
Represents a value that can be stored within {@see ContextInterface}.

Properties

$emptyBaggage  : self|null
$entries  : array<string|int, mixed>

Methods

__construct()  : mixed
activate()  : ScopeInterface
Adds `$this` to the {@see Context::getCurrent() current context} and makes the new {@see Context} the current context.
fromContext()  : BaggageInterface
Returns the {@see API\BaggageInterface} from the provided *$context*, falling back on {@see API\BaggageInterface::getEmpty()} if there is no baggage in the provided context.
getAll()  : iterable<string|int, mixed>
getBuilder()  : BaggageBuilderInterface
Returns a new empty {@see API\BaggageBuilderInterface}.
getCurrent()  : BaggageInterface
Returns the current {@see Baggage} from the current {@see ContextInterface}, falling back on {@see API\BaggageInterface::getEmpty()} if there is no baggage in the current context.
getEmpty()  : BaggageInterface
Returns a new {@see API\BaggageInterface} with no entries.
getEntry()  : Entry|null
getValue()  : mixed
Returns the value from the {@see API\Entry} with the provided *key*.
isEmpty()  : bool
storeInContext()  : ContextInterface
Returns a new {@see ContextInterface} created by setting `$this` into the provided [@see ContextInterface}.
toBuilder()  : BaggageBuilderInterface
Returns a new {@see API\BaggageBuilderInterface} pre-initialized with the contents of `$this`.

Properties

$emptyBaggage

private static self|null $emptyBaggage = null

$entries read-only

private array<string|int, mixed> $entries = []

Methods

__construct()

public __construct([array<string, Entry$entries = [] ]) : mixed
Parameters
$entries : array<string, Entry> = []

activate()

Adds `$this` to the {@see Context::getCurrent() current context} and makes the new {@see Context} the current context.

public activate() : ScopeInterface
Tags
inheritDoc
Return values
ScopeInterface

getAll()

public getAll() : iterable<string|int, mixed>
Tags
inheritDoc
Return values
iterable<string|int, mixed>

getCurrent()

Returns the current {@see Baggage} from the current {@see ContextInterface}, falling back on {@see API\BaggageInterface::getEmpty()} if there is no baggage in the current context.

public static getCurrent() : BaggageInterface
Tags
inheritDoc
Return values
BaggageInterface

getEntry()

public getEntry(string $key) : Entry|null
Parameters
$key : string
Tags
inheritDoc
Return values
Entry|null

getValue()

Returns the value from the {@see API\Entry} with the provided *key*.

public getValue(string $key) : mixed
Parameters
$key : string
Tags
inheritDoc

isEmpty()

public isEmpty() : bool
Tags
inheritDoc
Return values
bool

        
On this page

Search results