$storesCount = \
count($this->stores
);
foreach ($this->stores
as $store) { try { $store->
save($key);
++
$successCount;
} catch (\Exception
$e) { $this->logger?->
debug('One store failed to save the "{resource}" lock.',
['resource' =>
$key, 'store' =>
$store, 'exception' =>
$e]);
++
$failureCount;
} if (!
$this->strategy->
canBeMet($failureCount,
$storesCount)) { break;
} } $this->
checkNotExpired($key);
if ($this->strategy->
isMet($successCount,
$storesCount)) { return;
} $this->logger?->
info('Failed to store the "{resource}" lock. Quorum has not been met.',
['resource' =>
$key, 'success' =>
$successCount, 'failure' =>
$failureCount]);