File tree Expand file tree Collapse file tree 6 files changed +19
-5
lines changed Expand file tree Collapse file tree 6 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ interface BlockingSharedLockStoreInterface extends SharedLockStoreInterface
21
21
/**
22
22
* Waits until a key becomes free for reading, then stores the resource.
23
23
*
24
+ * @return void
25
+ *
24
26
* @throws LockConflictedException
25
27
*/
26
28
public function waitAndSaveRead (Key $ key );
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ interface BlockingStoreInterface extends PersistingStoreInterface
21
21
/**
22
22
* Waits until a key becomes free, then stores the resource.
23
23
*
24
+ * @return void
25
+ *
24
26
* @throws LockConflictedException
25
27
*/
26
28
public function waitAndSave (Key $ key );
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ public function acquire(bool $blocking = false): bool;
36
36
*
37
37
* @param float|null $ttl Maximum expected lock duration in seconds
38
38
*
39
+ * @return void
40
+ *
39
41
* @throws LockConflictedException If the lock is acquired by someone else
40
42
* @throws LockAcquiringException If the lock cannot be refreshed
41
43
*/
@@ -49,6 +51,8 @@ public function isAcquired(): bool;
49
51
/**
50
52
* Release the lock.
51
53
*
54
+ * @return void
55
+ *
52
56
* @throws LockReleasingException If the lock cannot be released
53
57
*/
54
58
public function release ();
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ interface PersistingStoreInterface
23
23
/**
24
24
* Stores the resource if it's not locked by someone else.
25
25
*
26
+ * @return void
27
+ *
26
28
* @throws LockAcquiringException
27
29
* @throws LockConflictedException
28
30
*/
@@ -31,6 +33,8 @@ public function save(Key $key);
31
33
/**
32
34
* Removes a resource from the storage.
33
35
*
36
+ * @return void
37
+ *
34
38
* @throws LockReleasingException
35
39
*/
36
40
public function delete (Key $ key );
@@ -45,6 +49,8 @@ public function exists(Key $key): bool;
45
49
*
46
50
* @param float $ttl amount of seconds to keep the lock in the store
47
51
*
52
+ * @return void
53
+ *
48
54
* @throws LockConflictedException
49
55
*/
50
56
public function putOffExpiration (Key $ key , float $ ttl );
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ interface SharedLockStoreInterface extends PersistingStoreInterface
21
21
/**
22
22
* Stores the resource if it's not locked for reading by someone else.
23
23
*
24
+ * @return void
25
+ *
24
26
* @throws LockConflictedException
25
27
*/
26
28
public function saveRead (Key $ key );
Original file line number Diff line number Diff line change @@ -472,16 +472,14 @@ public function testAcquireReadTwiceWithExpiration()
472
472
private $ keys = [];
473
473
private $ initialTtl = 30 ;
474
474
475
- public function save (Key $ key )
475
+ public function save (Key $ key ): void
476
476
{
477
477
$ key ->reduceLifetime ($ this ->initialTtl );
478
478
$ this ->keys [spl_object_hash ($ key )] = $ key ;
479
479
$ this ->checkNotExpired ($ key );
480
-
481
- return true ;
482
480
}
483
481
484
- public function delete (Key $ key )
482
+ public function delete (Key $ key ): void
485
483
{
486
484
unset($ this ->keys [spl_object_hash ($ key )]);
487
485
}
@@ -491,7 +489,7 @@ public function exists(Key $key): bool
491
489
return isset ($ this ->keys [spl_object_hash ($ key )]);
492
490
}
493
491
494
- public function putOffExpiration (Key $ key , $ ttl )
492
+ public function putOffExpiration (Key $ key , $ ttl ): void
495
493
{
496
494
$ key ->reduceLifetime ($ ttl );
497
495
$ this ->checkNotExpired ($ key );
You can’t perform that action at this time.
0 commit comments