TraceStateInterface
in
TraceState parses and stores the tracestate header as an immutable list of string key/value pairs. It provides the following operations following the rules described in the W3C Trace Context specification: - Get value for a given key - Add a new key/value pair - Update an existing value for a given key - Delete a key/value pair
All mutating operations return a new TraceState with the modifications applied.
Tags
Table of Contents
Methods
- __toString() : string
- Returns a string representation of this TraceSate
- get() : string|null
- Return the value of a given key from this TraceState if it exists
- getListMemberCount() : int
- Get the list-member count in this TraceState
- toString() : string
- Returns the concatenated string representation.
- with() : TraceStateInterface
- Return a new TraceState object that inherits from this TraceState and contains the given key value pair.
- without() : TraceStateInterface
- Return a new TraceState object that inherits from this TraceState without the given key value pair.
Methods
__toString()
Returns a string representation of this TraceSate
public
__toString() : string
Return values
stringget()
Return the value of a given key from this TraceState if it exists
public
get(string $key) : string|null
Parameters
- $key : string
Return values
string|nullgetListMemberCount()
Get the list-member count in this TraceState
public
getListMemberCount() : int
Return values
inttoString()
Returns the concatenated string representation.
public
toString([int|null $limit = null ]) : string
Parameters
- $limit : int|null = null
-
maximum length of the returned representation
Tags
Return values
string —the string representation
with()
Return a new TraceState object that inherits from this TraceState and contains the given key value pair.
public
with(string $key, string $value) : TraceStateInterface
Parameters
- $key : string
- $value : string
Return values
TraceStateInterfacewithout()
Return a new TraceState object that inherits from this TraceState without the given key value pair.
public
without(string $key) : TraceStateInterface
Parameters
- $key : string