Skip to content

Commit

Permalink
add first inmemory examples
Browse files Browse the repository at this point in the history
Signed-off-by: Koldo Picaza <1093654+kpicaza@users.noreply.github.com>
  • Loading branch information
pheaturebot committed Apr 20, 2021
1 parent fbf2c0f commit 2dbadc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Read/Toggle.php
Expand Up @@ -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);

Expand All @@ -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;
}

Expand Down

0 comments on commit 2dbadc5

Please sign in to comment.