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
2121 /**
2222 * Waits until a key becomes free for reading, then stores the resource.
2323 *
24+ * @return void
25+ *
2426 * @throws LockConflictedException
2527 */
2628 public function waitAndSaveRead (Key $ key );
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ interface BlockingStoreInterface extends PersistingStoreInterface
2121 /**
2222 * Waits until a key becomes free, then stores the resource.
2323 *
24+ * @return void
25+ *
2426 * @throws LockConflictedException
2527 */
2628 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;
3636 *
3737 * @param float|null $ttl Maximum expected lock duration in seconds
3838 *
39+ * @return void
40+ *
3941 * @throws LockConflictedException If the lock is acquired by someone else
4042 * @throws LockAcquiringException If the lock cannot be refreshed
4143 */
@@ -49,6 +51,8 @@ public function isAcquired(): bool;
4951 /**
5052 * Release the lock.
5153 *
54+ * @return void
55+ *
5256 * @throws LockReleasingException If the lock cannot be released
5357 */
5458 public function release ();
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ interface PersistingStoreInterface
2323 /**
2424 * Stores the resource if it's not locked by someone else.
2525 *
26+ * @return void
27+ *
2628 * @throws LockAcquiringException
2729 * @throws LockConflictedException
2830 */
@@ -31,6 +33,8 @@ public function save(Key $key);
3133 /**
3234 * Removes a resource from the storage.
3335 *
36+ * @return void
37+ *
3438 * @throws LockReleasingException
3539 */
3640 public function delete (Key $ key );
@@ -45,6 +49,8 @@ public function exists(Key $key): bool;
4549 *
4650 * @param float $ttl amount of seconds to keep the lock in the store
4751 *
52+ * @return void
53+ *
4854 * @throws LockConflictedException
4955 */
5056 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
2121 /**
2222 * Stores the resource if it's not locked for reading by someone else.
2323 *
24+ * @return void
25+ *
2426 * @throws LockConflictedException
2527 */
2628 public function saveRead (Key $ key );
Original file line number Diff line number Diff line change @@ -472,16 +472,14 @@ public function testAcquireReadTwiceWithExpiration()
472472 private $ keys = [];
473473 private $ initialTtl = 30 ;
474474
475- public function save (Key $ key )
475+ public function save (Key $ key ): void
476476 {
477477 $ key ->reduceLifetime ($ this ->initialTtl );
478478 $ this ->keys [spl_object_hash ($ key )] = $ key ;
479479 $ this ->checkNotExpired ($ key );
480-
481- return true ;
482480 }
483481
484- public function delete (Key $ key )
482+ public function delete (Key $ key ): void
485483 {
486484 unset($ this ->keys [spl_object_hash ($ key )]);
487485 }
@@ -491,7 +489,7 @@ public function exists(Key $key): bool
491489 return isset ($ this ->keys [spl_object_hash ($ key )]);
492490 }
493491
494- public function putOffExpiration (Key $ key , $ ttl )
492+ public function putOffExpiration (Key $ key , $ ttl ): void
495493 {
496494 $ key ->reduceLifetime ($ ttl );
497495 $ this ->checkNotExpired ($ key );
You can’t perform that action at this time.
0 commit comments