diff --git a/src/Mutex/RedisServerMutex.php b/src/Mutex/RedisServerMutex.php index aa3392d..bce4510 100644 --- a/src/Mutex/RedisServerMutex.php +++ b/src/Mutex/RedisServerMutex.php @@ -56,7 +56,7 @@ public function __construct( $this->retryInterval = (int) ($options['retry_interval'] ?? 10); } - public function attempt(callable $callback = null): void + public function attempt(?callable $callback = null): void { // Waiting for the server mutex. $this->timer->tick($this->retryInterval, function () { diff --git a/src/Mutex/ServerMutexInterface.php b/src/Mutex/ServerMutexInterface.php index 6afe143..208b2e9 100644 --- a/src/Mutex/ServerMutexInterface.php +++ b/src/Mutex/ServerMutexInterface.php @@ -13,7 +13,7 @@ interface ServerMutexInterface { - public function attempt(callable $callback = null); + public function attempt(?callable $callback = null); public function release(bool $force = false); }