@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * @phpstan-ignore-next-line |
| 33 | 33 | * @psalm-suppress TooManyTemplateParams |
| 34 | 34 | */ |
| 35 | - return $this->locks->has($key)->then(function (bool $has) use ($key, $ttl): ?Lock { |
|
| 35 | + return $this->locks->has($key)->then(function(bool $has) use ($key, $ttl): ?Lock { |
|
| 36 | 36 | if ($has) { |
| 37 | 37 | return null; |
| 38 | 38 | } |
@@ -50,12 +50,12 @@ discard block |
||
| 50 | 50 | /** |
| 51 | 51 | * @phpstan-ignore-next-line |
| 52 | 52 | */ |
| 53 | - return $this->acquire($key, $ttl)->then(function (?LockInterface $lock) use ($key, $ttl, $attempts, $interval): PromiseInterface { |
|
| 53 | + return $this->acquire($key, $ttl)->then(function(?LockInterface $lock) use ($key, $ttl, $attempts, $interval) : PromiseInterface { |
|
| 54 | 54 | if ($lock instanceof LockInterface || $attempts === self::NO_MORE_ATTEMPTS_LEFT) { |
| 55 | 55 | return resolve($lock); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - return timedPromise($interval, [$key, $ttl, --$attempts, $interval])->then(function (array $args): PromiseInterface { |
|
| 58 | + return timedPromise($interval, [ $key, $ttl, --$attempts, $interval ])->then(function(array $args): PromiseInterface { |
|
| 59 | 59 | return $this->spin(...$args); |
| 60 | 60 | }); |
| 61 | 61 | }); |
@@ -66,11 +66,11 @@ discard block |
||
| 66 | 66 | /** |
| 67 | 67 | * @psalm-suppress TooManyTemplateParams |
| 68 | 68 | */ |
| 69 | - return $this->locks->has($lock->key())->then(function (bool $has) use ($lock) { |
|
| 69 | + return $this->locks->has($lock->key())->then(function(bool $has) use ($lock) { |
|
| 70 | 70 | return $has ? $this->locks->get($lock->key()) : $has; |
| 71 | 71 | })->then( |
| 72 | 72 | /** @phpstan-ignore-next-line */ |
| 73 | - function (?Lock $storedLock) use ($lock) { |
|
| 73 | + function(?Lock $storedLock) use ($lock) { |
|
| 74 | 74 | if ($storedLock instanceof Lock && $storedLock->rng() === $lock->rng()) { |
| 75 | 75 | return $this->locks->delete($lock->key()); |
| 76 | 76 | } |