LaunchDarkly PHP SDK 6.8.0

EvaluationSeriesContext
in package

Contextual information provided to stages of the evaluation series.

One instance is provided to each stage of the evaluation series. The instance passed to beforeEvaluation and the one passed to afterEvaluation may differ in their environmentId value: the env ID is unknown until the SDK has fetched flag data from LaunchDarkly at least once, so the first variation call's beforeEvaluation typically sees null while its afterEvaluation sees the captured value. See EvaluationSeriesContext::$environmentId.

Table of Contents

$context  : LDContext
$defaultValue  : mixed
$environmentId  : string|null
$flagKey  : string
$method  : string
__construct()  : mixed

Properties

Methods

__construct()

public __construct(string $flagKey, LDContext $context, mixed $defaultValue, string $method[, string|null $environmentId = null ]) : mixed
Parameters
$flagKey : string

The key of the flag being evaluated.

$context : LDContext

The evaluation context.

$defaultValue : mixed

The default value the caller passed to the variation method.

$method : string

The variation method being executed (e.g. variation, variationDetail).

$environmentId : string|null = null

The LaunchDarkly environment ID associated with the SDK key, if known. Populated from the X-Ld-Envid response header when the SDK fetches flags directly from LaunchDarkly. Always null when using a persistent-store feature requester (e.g. Redis, Consul, DynamoDB), and null for the very first variation call's beforeEvaluation stage in a PHP process (the value is captured during evaluation).

Return values
mixed

Search results