Skip to content

AssignmentStrategy ​

Rasuvaeff\Yii3AbTesting\AssignmentStrategy

Interface · rasuvaeff/yii3-ab-testing · Source

Methods ​

assign() ​

php
assign(
    string $salt,
    string $subjectId,
    array $variants,
): string

Picks a variant for the subject. Callers must pass at least one variant with a total weight greater than 0 (Experiment guarantees this); implementations throw \InvalidArgumentException otherwise.

  • $variants — name => weight