Skip to content
Permalink
Browse files

hotfix for situation when faker don’t have enough values -> allow for…

… duplicates
  • Loading branch information...
tsurowiec committed Jun 10, 2019
1 parent f1fc5b9 commit 8aded500255d586c40d8a97e60b943e90a5e8958
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/Fogger/Mask/AbstractCachedMask.php
@@ -49,10 +49,14 @@ public function apply(?string $value, array $options = []): ?string
$originalValueCacheItem->set(self::LOCK_VALUE);
$this->cache->save($originalValueCacheItem);
}
$tries = 0;
do {
$tries++;
$substitution = $this->getSubstitution($options);
$substitutionCacheItem = $this->cache->getItem($this->forgeCacheKey($substitution, $options, true));
if ($tries == 100) {
break;
}
} while ($substitutionCacheItem->isHit());
$this->cache->save($substitutionCacheItem);

0 comments on commit 8aded50

Please sign in to comment.
You can’t perform that action at this time.