Skip to content

Commit

Permalink
Updated docblock for LockInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
huangdijia committed Aug 7, 2024
1 parent ef6cc6b commit 65528d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lock/src/Driver/AbstractLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ abstract public function release(): bool;

/**
* Attempt to acquire the lock.
* @return mixed
* {@inheritdoc}
*/
#[Override]
public function get(?callable $callback = null)
Expand All @@ -72,7 +72,7 @@ public function get(?callable $callback = null)

/**
* Attempt to acquire the lock for the given number of seconds.
* @return mixed
* {@inheritdoc}
* @throws LockTimeoutException
*/
#[Override]
Expand Down
8 changes: 7 additions & 1 deletion src/lock/src/Driver/LockInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ interface LockInterface
{
/**
* Attempt to acquire the lock.
* @return mixed
* @template T
* @param (callable(): T)|null $callback
* @return ($callback is null ? bool : T)
*/
public function get(?callable $callback = null);

/**
* Attempt to acquire the lock for the given number of seconds.
*
* @template T
* @param (callable(): T)|null $callback
* @return ($callback is null ? bool : T)
*/
public function block(int $seconds, ?callable $callback = null);

Expand Down

0 comments on commit 65528d7

Please sign in to comment.