Skip to content

Commit cf157e0

Browse files
committed
psalm tweaks
1 parent 666e934 commit cf157e0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/Custodian.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function acquire(string $resource, float $ttl, ?string $token = null): Pr
5757
$token = Lock::generateToken();
5858
}
5959

60+
/** @psalm-suppress InvalidScalarArgument */
6061
return $this->client->set($resource, $token, 'NX', 'PX', (int) round($ttl * 1000))
6162
->then(function (?string $reply) use ($resource, $ttl, $token): ?Lock {
6263
if (is_null($reply) || ($reply !== 'OK')) {
@@ -109,6 +110,7 @@ public function spin(int $attempts, float $interval, string $resource, float $tt
109110
*/
110111
public function release(Lock $lock): PromiseInterface
111112
{
113+
/** @psalm-suppress InvalidScalarArgument */
112114
return $this->client->eval(self::RELEASE_SCRIPT, 1, $lock->getResource(), $lock->getToken())
113115
->then(function (?string $reply): bool {
114116
return $reply === '1';

0 commit comments

Comments
 (0)