Skip to content

Commit

Permalink
fix: variant selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Tymek committed Oct 31, 2023
1 parent 4dce956 commit 29685ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/DefaultUnleash.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,11 @@ private function getVariantForFeature(?Feature $feature, ?Context $context = nul
$featureName = $feature->getName();

if (count($strategyVariants) != 0) {
$variant = $this->variantHandler->selectVariant($feature->getVariants(), $featureName, $context);
} else {
$variant = $this->variantHandler->selectVariant($strategyVariants, $enabledResult->getStrategy()?->getParameters()['groupId'] ?? '', $context);
} else {
$variant = $this->variantHandler->selectVariant($feature->getVariants(), $featureName, $context);
}

if ($variant !== null) {
$this->metricsHandler->handleMetrics($feature, true, $variant);

Expand Down

0 comments on commit 29685ba

Please sign in to comment.