public function __wakeup(): void
{ throw new \
BadMethodCallException('Cannot unserialize '.__CLASS__
);
} /**
* Automatically releases the underlying semaphore when the object is destructed.
*/
public function __destruct() { if (!
$this->autoRelease || !
$this->dirty || !
$this->
isAcquired()) { return;
} $this->
release();
} public function acquire(): bool
{ try { $this->key->
resetLifetime();
$this->store->
save($this->key,
$this->ttlInSecond
);