DecisionManager
in package
Table of Contents
Properties
- $logger : LoggerInterface
- $storage : StorageFacadeInterface
- $trafficAllocationManager : TrafficAllocationManager
- $userProvider : UserProviderInterface
- $voterRegistry : VoterRegistry
Methods
- __construct() : mixed
- decide() : array<string|int, Decision>
- Decide which experiments and variations to show to the user
- getExperimentsSortedByPriority() : array<string|int, mixed>
- Get experiments sorted by priority in ascending order
- calculateVariation() : array<string|int, mixed>|null
- Calculate which variation to show based on traffic allocation and buckets
Properties
$logger
private
LoggerInterface
$logger
$storage
private
StorageFacadeInterface
$storage
$trafficAllocationManager
private
TrafficAllocationManager
$trafficAllocationManager
$userProvider
private
UserProviderInterface
$userProvider
$voterRegistry
private
VoterRegistry
$voterRegistry
Methods
__construct()
public
__construct(StorageFacadeInterface $storage, UserProviderInterface $userProvider) : mixed
Parameters
- $storage : StorageFacadeInterface
- $userProvider : UserProviderInterface
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>getExperimentsSortedByPriority()
Get experiments sorted by priority in ascending order
public
getExperimentsSortedByPriority() : array<string|int, mixed>
Return values
array<string|int, mixed>calculateVariation()
Calculate which variation to show based on traffic allocation and buckets
private
calculateVariation(Experiment $experiment, User $user) : array<string|int, mixed>|null
Parameters
- $experiment : Experiment
- $user : User
Return values
array<string|int, mixed>|null —The selected variation or null if no variation should be shown