AudienceVoter
extends AbstractVoter
in package
Table of Contents
Properties
- $NAME : string
Methods
- getName() : string
- Get the name of the voter
- vote() : bool
- Vote whether an experiment should be applied based on the context
- matchValue() : bool
- Match a value against audience rules
- voteForScreen() : bool
- Vote for screen-based audience rules
- voteForUrl() : bool
- Vote for URL-based audience rules
Properties
$NAME
protected
static string
$NAME
= 'audience'
Methods
getName()
Get the name of the voter
public
getName() : string
Return values
stringvote()
Vote whether an experiment should be applied based on the context
public
vote(Context $context, Experiment $experiment) : bool
Parameters
- $context : Context
- $experiment : Experiment
Return values
boolmatchValue()
Match a value against audience rules
private
matchValue(string $value, array<string|int, mixed> $rules, string $type) : bool
Parameters
- $value : string
- $rules : array<string|int, mixed>
- $type : string
Return values
boolvoteForScreen()
Vote for screen-based audience rules
private
voteForScreen(Context $context, Experiment $experiment) : bool
Parameters
- $context : Context
- $experiment : Experiment
Return values
boolvoteForUrl()
Vote for URL-based audience rules
private
voteForUrl(Context $context, Experiment $experiment) : bool
Parameters
- $context : Context
- $experiment : Experiment