Experiments
in package
Class Experiments
Table of Contents
- $draft : array<string|int, mixed>
- Array of draft experiments
- $running : array<string|int, mixed>
- Array of running experiments
- getCurrent() : Experiment|null
- Return the current running Experiment
- getDraft() : array<string|int, mixed>
- getRunning() : array<string|int, mixed>
- parse() : self
- Parses a given experiments. Not meant to be used except for testing.
- refFromCookie() : null|string
- Given the value of an experiment cookie, return the corresponding Ref as a string
- __construct() : mixed
- findRunningById() : null|Experiment
- Find the running experiment with the given Google ID
Properties
$draft
Array of draft experiments
private
array<string|int, mixed>
$draft
$running
Array of running experiments
private
array<string|int, mixed>
$running
Methods
getCurrent()
Return the current running Experiment
public
getCurrent() : Experiment|null
Return values
Experiment|null —getDraft()
public
getDraft() : array<string|int, mixed>
Return values
array<string|int, mixed> —getRunning()
public
getRunning() : array<string|int, mixed>
Return values
array<string|int, mixed> —parse()
Parses a given experiments. Not meant to be used except for testing.
public
static parse(stdClass $json) : self
Parameters
- $json : stdClass
-
the json bit retrieved from the API that represents experiments.
Return values
self —the manipulable object for the experiments.
refFromCookie()
Given the value of an experiment cookie, return the corresponding Ref as a string
public
refFromCookie(null|string $cookie) : null|string
Parameters
- $cookie : null|string
Return values
null|string —__construct()
private
__construct(array<string|int, mixed> $draft, array<string|int, mixed> $running) : mixed
Parameters
- $draft : array<string|int, mixed>
- $running : array<string|int, mixed>
Return values
mixed —findRunningById()
Find the running experiment with the given Google ID
private
findRunningById(string $id) : null|Experiment
Parameters
- $id : string