DX: fix data type with new rules for phpstan

This commit is contained in:
Julien Fastré 2023-11-05 23:19:00 +01:00
parent dc860d0c46
commit 68f56671a4
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -52,7 +52,16 @@ class ChillDocumentLockManager implements DocumentLockManagerInterface
public function hasLock(Document $document, RequestInterface $request): bool
{
return $this->redis->exists($this->getCacheId($document)) > 0;
$r = $this->redis->exists($this->getCacheId($document));
if (is_bool($r)) {
return $r;
}
if (is_int($r)) {
return $r > 0;
}
throw new \RuntimeException('data type not supported');
}
public function setLock(Document $document, string $lockId, RequestInterface $request): bool