EvaluationDetail
in package
An object that combines the result of a flag evaluation with an explanation of how it was calculated.
This is returned by LDClient::variationDetail().
Table of Contents
- __construct() : mixed
- EvaluationDetail constructor.
- getReason() : EvaluationReason
- Returns information about how the flag value was calculated.
- getValue() : mixed
- Returns the result of the flag evaluation. This will be either one of the flag's variations or the default value that was passed to the {@see \LaunchDarkly\LDClient::variationDetail()} method.
- getVariationIndex() : int|null
- The index of the returned value within the flag's list of variations, e.g. 0 for the first variation-- or null if it was the default value (evaluation failed).
- isDefaultValue() : bool
- Returns true if the flag evaluated to the default value, rather than one of its variations.
Methods
__construct()
EvaluationDetail constructor.
public
__construct(mixed $value, int|null $variationIndex, EvaluationReason $reason) : mixed
Parameters
- $value : mixed
-
the value of the flag variation
- $variationIndex : int|null
-
the index of the flag variation, or null if it was the default value
- $reason : EvaluationReason
-
evaluation reason properties
Return values
mixed —getReason()
Returns information about how the flag value was calculated.
public
getReason() : EvaluationReason
Return values
EvaluationReason —getValue()
Returns the result of the flag evaluation. This will be either one of the flag's variations or the default value that was passed to the {@see \LaunchDarkly\LDClient::variationDetail()} method.
public
getValue() : mixed
Return values
mixed —the flag value
getVariationIndex()
The index of the returned value within the flag's list of variations, e.g. 0 for the first variation-- or null if it was the default value (evaluation failed).
public
getVariationIndex() : int|null
Return values
int|null —the variation index if applicable
isDefaultValue()
Returns true if the flag evaluated to the default value, rather than one of its variations.
public
isDefaultValue() : bool