Explore Server Side Testing SDK for PHP

ExploreClient

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

$lastDecisions

private array<string|int, mixed> $lastDecisions = []

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
throws
ExploreClientException

If API request fails

Return values
bool

True if experiments were successfully fetched and stored

getExperimentsConfig()

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>

getWebsiteId()

Get the website id

public getWebsiteId() : string
Return values
string

fetchAndUpdateExperiments()

Fetch and update experiments and related settings

private fetchAndUpdateExperiments() : mixed

refreshExperiments()

Refresh experiments if needed based on various conditions

private refreshExperiments() : mixed

        
On this page

Search results