ExploreClient
in package
Class ExploreClient
Table of Contents
Properties
- $decisionManager : DecisionManager
- $config : ClientConfig
- $denormalizer : JsonDenormalizer
- $httpClient : HttpClientInterface
- $lastDecisions : array<string|int, mixed>
- $storage : StorageFacadeInterface
- $tracker : Tracker
- $userProvider : UserProvider
Methods
- __construct() : mixed
- ExploreClient constructor.
- decide() : array<string|int, Decision>
- Decide which experiments and variations to show to the user
- fetchAndStoreExperimentsConfig() : bool
- Fetch experiments from the API and store them
- getConfig() : ClientConfig
- Get the client configuration
- getDecisionManager() : DecisionManager
- Get the decision manager
- getExperimentsConfig() : array<string|int, mixed>
- Get experiments config
- getLastDecisions() : array<string|int, mixed>
- Get the last decisions made
- getTracker() : Tracker
- Get the tracker
- getWebsiteId() : string
- Get the website id
- fetchAndUpdateExperiments() : mixed
- Fetch and update experiments and related settings
- refreshExperiments() : mixed
- Refresh experiments if needed based on various conditions
Properties
$decisionManager
protected
DecisionManager
$decisionManager
$config
private
ClientConfig
$config
$denormalizer
private
JsonDenormalizer
$denormalizer
$httpClient
private
HttpClientInterface
$httpClient
$lastDecisions
private
array<string|int, mixed>
$lastDecisions
= []
$storage
private
StorageFacadeInterface
$storage
$tracker
private
Tracker
$tracker
$userProvider
private
UserProvider
$userProvider
Methods
__construct()
ExploreClient constructor.
public
__construct(HttpClientInterface $client, StorageFacadeInterface $storage, UserProviderInterface $userProvider[, ClientConfig|null $config = null ][, DecisionManager|null $decisionManager = null ][, Tracker|null $tracker = null ]) : mixed
Parameters
- $client : HttpClientInterface
- $storage : StorageFacadeInterface
- $userProvider : UserProviderInterface
- $config : ClientConfig|null = null
- $decisionManager : DecisionManager|null = null
- $tracker : Tracker|null = null
decide()
Decide which experiments and variations to show to the user
public
decide(Context $context[, string $experimentKey = "" ]) : array<string|int, Decision>
Parameters
- $context : Context
- $experimentKey : string = ""
Return values
array<string|int, Decision>fetchAndStoreExperimentsConfig()
Fetch experiments from the API and store them
public
fetchAndStoreExperimentsConfig() : bool
Tags
Return values
bool —True if experiments were successfully fetched and stored
getConfig()
Get the client configuration
public
getConfig() : ClientConfig
Return values
ClientConfiggetDecisionManager()
Get the decision manager
public
getDecisionManager() : DecisionManager
Return values
DecisionManagergetExperimentsConfig()
Get experiments config
public
getExperimentsConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>getLastDecisions()
Get the last decisions made
public
getLastDecisions() : array<string|int, mixed>
Return values
array<string|int, mixed>getTracker()
Get the tracker
public
getTracker() : Tracker
Return values
TrackergetWebsiteId()
Get the website id
public
getWebsiteId() : string
Return values
stringfetchAndUpdateExperiments()
Fetch and update experiments and related settings
private
fetchAndUpdateExperiments() : mixed
refreshExperiments()
Refresh experiments if needed based on various conditions
private
refreshExperiments() : mixed