Explore Server Side Testing SDK for PHP

SegmentVoter extends AbstractVoter

Voter for segment

Table of Contents

Properties

$NAME  : string
$userProvider  : UserProviderInterface

Methods

__construct()  : mixed
getName()  : string
Get the name of the voter
vote()  : bool
Vote whether an experiment should be applied based on the context
compareValues()  : bool
Compare two values based on the comparison type
evaluateCondition()  : bool
Evaluate a single condition against the context
evaluateSegment()  : bool
Evaluate a segment against the context
getContextParamClass()  : string|null
Get the context parameter class name based on parameter name
getContextValue()  : mixed|null
Get the value from context based on parameter name

Properties

Methods

getName()

Get the name of the voter

public getName() : string
Return values
string

compareValues()

Compare two values based on the comparison type

private compareValues(mixed $value1, mixed $value2[, string|null $type = null ]) : bool
Parameters
$value1 : mixed
$value2 : mixed
$type : string|null = null
Return values
bool

evaluateCondition()

Evaluate a single condition against the context

private evaluateCondition(Context $context, array<string|int, mixed> $condition) : bool
Parameters
$context : Context
$condition : array<string|int, mixed>
Return values
bool

evaluateSegment()

Evaluate a segment against the context

private evaluateSegment(Context $context, array<string|int, mixed> $segment) : bool
Parameters
$context : Context
$segment : array<string|int, mixed>
Return values
bool

getContextParamClass()

Get the context parameter class name based on parameter name

private getContextParamClass(string $parameter[, Context|null $context = null ]) : string|null
Parameters
$parameter : string
$context : Context|null = null

Optional context for building the mapping

Return values
string|null

getContextValue()

Get the value from context based on parameter name

private getContextValue(Context $context, array<string|int, mixed> $condition) : mixed|null
Parameters
$context : Context
$condition : array<string|int, mixed>
Return values
mixed|null

        
On this page

Search results