public function release(): void
{ try { try { $this->store->
delete($this->key
);
$this->dirty = false;
} catch (LockReleasingException
$e) { throw $e;
} catch (\Exception
$e) { throw new LockReleasingException(sprintf('Failed to release the "%s" lock.',
$this->key
), 0,
$e);
} if ($this->store->
exists($this->key
)) { throw new LockReleasingException(sprintf('Failed to release the "%s" lock, the resource is still locked.',
$this->key
));
} $this->logger?->
debug('Successfully released the "{resource}" lock.',
['resource' =>
$this->key
]);
} catch (LockReleasingException
$e) { $this->logger?->
notice('Failed to release the "{resource}" lock.',
['resource' =>
$this->key
]);
throw $e;
} }