Skip to content

Commit

Permalink
fix: getVariantForFeature
Browse files Browse the repository at this point in the history
  • Loading branch information
Tymek committed Oct 2, 2023
1 parent 919a2c6 commit 93f57fb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/DefaultUnleash.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,15 @@ public function isDependencySatisfied(
return true;
}

private function getVariantForFeature(?Feature $feature, ?Context $context = null, array $dependencies = [], ?Variant $fallbackVariant = null): Variant
/**
* Selects a variant from a feature.
*
* @param Feature $feature the feature to check
* @param Context $context the context to use
* @param ?array<string, Feature> $dependencies parent feature toggles
* @param ?Variant $fallbackVariant the default value to return if the feature is not found
*/
private function getVariantForFeature(?Feature $feature, ?Context $context = null, $dependencies = [], ?Variant $fallbackVariant = null): Variant
{
$fallbackVariant ??= $this->variantHandler->getDefaultVariant();
$context ??= $this->configuration->getContextProvider()->getContext();
Expand Down

0 comments on commit 93f57fb

Please sign in to comment.