LaunchDarkly\OpenFeature 1.0.0

Provider implements Provider

An OpenFeatureProvider which enables the use of the LaunchDarkly Server-Side SDK for PHP with OpenFeature.

Interfaces, Classes and Traits

Provider

Table of Contents

VERSION  = '1.0.0'
__construct()  : mixed
Instantiate a new instance of this provider, backed by the provided LDClient instance.
getHooks()  : array<string|int, mixed>
getMetadata()  : Metadata
resolveBooleanValue()  : ResolutionDetails
Resolves the flag value for the provided flag key as a boolean
resolveFloatValue()  : ResolutionDetails
Resolves the flag value for the provided flag key as a float
resolveIntegerValue()  : ResolutionDetails
Resolves the flag value for the provided flag key as an integer
resolveObjectValue()  : ResolutionDetails
Resolves the flag value for the provided flag key as an object
resolveStringValue()  : ResolutionDetails
Resolves the flag value for the provided flag key as a string
setLogger()  : void
Sets a logger instance on the object.

Constants

Methods

__construct()

Instantiate a new instance of this provider, backed by the provided LDClient instance.

public __construct(string $sdkKey[, array<string, mixed> $options = [] ]) : mixed
Parameters
$sdkKey : string
$options : array<string, mixed> = []

These options are passed directly to the underlying LDClient constructor.

Tags
params

string $sdkKey The SDK key to use when connecting to LaunchDarkly.

Return values
mixed

getHooks()

public getHooks() : array<string|int, mixed>
Return values
array<string|int, mixed>

getMetadata()

public getMetadata() : Metadata
Return values
Metadata

resolveBooleanValue()

Resolves the flag value for the provided flag key as a boolean

public resolveBooleanValue(string $flagKey, bool $defaultValue[, EvaluationContext|null $context = null ]) : ResolutionDetails
Parameters
$flagKey : string
$defaultValue : bool
$context : EvaluationContext|null = null
Return values
ResolutionDetails

resolveFloatValue()

Resolves the flag value for the provided flag key as a float

public resolveFloatValue(string $flagKey, float $defaultValue[, EvaluationContext|null $context = null ]) : ResolutionDetails
Parameters
$flagKey : string
$defaultValue : float
$context : EvaluationContext|null = null
Return values
ResolutionDetails

resolveIntegerValue()

Resolves the flag value for the provided flag key as an integer

public resolveIntegerValue(string $flagKey, int $defaultValue[, EvaluationContext|null $context = null ]) : ResolutionDetails
Parameters
$flagKey : string
$defaultValue : int
$context : EvaluationContext|null = null
Return values
ResolutionDetails

resolveObjectValue()

Resolves the flag value for the provided flag key as an object

public resolveObjectValue(string $flagKey, array<string|int, mixed> $defaultValue[, EvaluationContext|null $context = null ]) : ResolutionDetails
Parameters
$flagKey : string
$defaultValue : array<string|int, mixed>
$context : EvaluationContext|null = null
Return values
ResolutionDetails

resolveStringValue()

Resolves the flag value for the provided flag key as a string

public resolveStringValue(string $flagKey, string $defaultValue[, EvaluationContext|null $context = null ]) : ResolutionDetails
Parameters
$flagKey : string
$defaultValue : string
$context : EvaluationContext|null = null
Return values
ResolutionDetails

setLogger()

Sets a logger instance on the object.

public setLogger(LoggerInterface $logger) : void

NOTE: Changing the logger in this way will affect the logger used by the EvaluationContextConverter. However, it will not affect the logger used by the underlyling LDClient instance.

If this functionality is important to you, please reach out to your LaunchDarkly support contact, or open an issue on the GitHub repository for this library.

Parameters
$logger : LoggerInterface
Return values
void

Search results