Skip to content

Commit 8aded50

Browse files
committed
hotfix for situation when faker don’t have enough values -> allow for duplicates
1 parent f1fc5b9 commit 8aded50

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Fogger/Mask/AbstractCachedMask.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,14 @@ public function apply(?string $value, array $options = []): ?string
4949
$originalValueCacheItem->set(self::LOCK_VALUE);
5050
$this->cache->save($originalValueCacheItem);
5151
}
52-
52+
$tries = 0;
5353
do {
54+
$tries++;
5455
$substitution = $this->getSubstitution($options);
5556
$substitutionCacheItem = $this->cache->getItem($this->forgeCacheKey($substitution, $options, true));
57+
if ($tries == 100) {
58+
break;
59+
}
5660
} while ($substitutionCacheItem->isHit());
5761
$this->cache->save($substitutionCacheItem);
5862

0 commit comments

Comments
 (0)