OpenTelemetry PHP

EnvResolver

Helper class to access environment-based configuration.

Table of Contents

Methods

bool()  : bool|null
Resolves a boolean-valued environment variable.
enum()  : string|null
Resolves an enum-valued environment variable.
int()  : int|null
Resolves an integer-valued environment variable.
list()  : array<int, string>|null
Resolves a list-valued environment variable.
map()  : array<string, string>|null
Resolves a map-valued environment variable.
numeric()  : int|float|null
Resolves a numeric-valued environment variable.
string()  : string|null
Resolves a string-valued environment variable.

Methods

int()

Resolves an integer-valued environment variable.

public int(string $name[, int|null $min = 0 ][, int|null $max = ~(-1 << 31) ]) : int|null
Parameters
$name : string

environment variable name

$min : int|null = 0

lower limit (inclusive), defaults to 0

$max : int|null = ~(-1 << 31)

upper limit (inclusive), defaults to 2^31-1

Tags
see
https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#numeric-value
Return values
int|null

value of the environment variable, or null if not set or invalid

list()

Resolves a list-valued environment variable.

public list(string $name) : array<int, string>|null
Parameters
$name : string

environment variable name

Return values
array<int, string>|null

value of the environment variable, or null if not set or invalid

map()

Resolves a map-valued environment variable.

public map(string $name) : array<string, string>|null
Parameters
$name : string

environment variable name

Return values
array<string, string>|null

value of the environment variable, or null if not set or invalid

numeric()

Resolves a numeric-valued environment variable.

public numeric(string $name[, int|float|null $min = 0 ][, int|float|null $max = ~(-1 << 31) ]) : int|float|null
Parameters
$name : string

environment variable name

$min : int|float|null = 0

lower limit (inclusive), defaults to 0

$max : int|float|null = ~(-1 << 31)

upper limit (inclusive), defaults to 2^31-1

Tags
see
https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#numeric-value
Return values
int|float|null

value of the environment variable, or null if not set or invalid


        
On this page

Search results