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
$context read-only
public
LDContext
$context
$defaultValue read-only
public
mixed
$defaultValue
$environmentId read-only
public
string|null
$environmentId
= null
$flagKey read-only
public
string
$flagKey
$method read-only
public
string
$method
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-Envidresponse header when the SDK fetches flags directly from LaunchDarkly. Alwaysnullwhen using a persistent-store feature requester (e.g. Redis, Consul, DynamoDB), andnullfor the very first variation call'sbeforeEvaluationstage in a PHP process (the value is captured during evaluation).