From 2dbadc50f346115a2f09ed2bc04e3df4cc7c22ca Mon Sep 17 00:00:00 2001 From: pheaturebot <82849140+pheaturebot@users.noreply.github.com> Date: Tue, 20 Apr 2021 21:35:39 +0000 Subject: [PATCH] add first inmemory examples Signed-off-by: Koldo Picaza <1093654+kpicaza@users.noreply.github.com> --- src/Read/Toggle.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Read/Toggle.php b/src/Read/Toggle.php index 84e2037..2cb6802 100644 --- a/src/Read/Toggle.php +++ b/src/Read/Toggle.php @@ -14,7 +14,7 @@ public function __construct(FeatureFinder $featureRepository) $this->featureFinder = $featureRepository; } - public function isEnabled(string $featureId, ConsumerIdentity $identity): bool + public function isEnabled(string $featureId, ?ConsumerIdentity $identity = null): bool { $feature = $this->featureFinder->get($featureId); @@ -24,7 +24,7 @@ public function isEnabled(string $featureId, ConsumerIdentity $identity): bool $strategies = $feature->strategies(); - if (self::ZERO === $strategies->count()) { + if (self::ZERO === $strategies->count() || null === $identity) { return true; }