Revert "package update 재도전"

This reverts commit 595ab6d7e5675490afea91d5367b24c76d05fbe8.
This commit is contained in:
2020-01-28 00:31:53 +09:00
parent f6e53746b2
commit 19be0c4560
419 changed files with 16269 additions and 14006 deletions
+8 -5
View File
@@ -20,14 +20,14 @@ final class Key
{
private $resource;
private $expiringTime;
private $state = [];
private $state = array();
public function __construct(string $resource)
{
$this->resource = $resource;
}
public function __toString(): string
public function __toString()
{
return $this->resource;
}
@@ -60,7 +60,7 @@ final class Key
/**
* @param float $ttl the expiration delay of locks in seconds
*/
public function reduceLifetime(float $ttl)
public function reduceLifetime($ttl)
{
$newTime = microtime(true) + $ttl;
@@ -74,12 +74,15 @@ final class Key
*
* @return float|null Remaining lifetime in seconds. Null when the key won't expire.
*/
public function getRemainingLifetime(): ?float
public function getRemainingLifetime()
{
return null === $this->expiringTime ? null : $this->expiringTime - microtime(true);
}
public function isExpired(): bool
/**
* @return bool
*/
public function isExpired()
{
return null !== $this->expiringTime && $this->expiringTime <= microtime(true);
}