@@ -34,19 +34,19 @@ abstract class RedisMutex extends SpinlockMutex implements LoggerAwareInterface
3434 *
3535 * @param array $redisAPIs The Redis APIs.
3636 * @param string $name The lock name.
37- * @param int $timeout The time in seconds a lock expires, default is 3.
37+ * @param float $timeout The time in seconds a lock expires, default is 3.
3838 *
3939 * @throws \LengthException The timeout must be greater than 0.
4040 */
41- public function __construct (array $ redisAPIs , string $ name , int $ timeout = 3 )
41+ public function __construct (array $ redisAPIs , string $ name , float $ timeout = 3 )
4242 {
4343 parent ::__construct ($ name , $ timeout );
4444
4545 $ this ->redisAPIs = $ redisAPIs ;
4646 $ this ->logger = new NullLogger ();
4747 }
4848
49- protected function acquire (string $ key , int $ expire ): bool
49+ protected function acquire (string $ key , float $ expire ): bool
5050 {
5151 // 1. This differs from the specification to avoid an overflow on 32-Bit systems.
5252 $ time = microtime (true );
@@ -149,14 +149,14 @@ private function isMajority(int $count): bool
149149 /**
150150 * Sets the key only if such key doesn't exist at the server yet.
151151 *
152- * @param mixed $redisAPI The connected Redis API.
153- * @param string $key The key.
154- * @param string $value The value.
155- * @param int $expire The TTL seconds.
152+ * @param mixed $redisAPI The connected Redis API.
153+ * @param string $key The key.
154+ * @param string $value The value.
155+ * @param float $expire The TTL seconds.
156156 *
157157 * @return bool True, if the key was set.
158158 */
159- abstract protected function add ($ redisAPI , string $ key , string $ value , int $ expire ): bool ;
159+ abstract protected function add ($ redisAPI , string $ key , string $ value , float $ expire ): bool ;
160160
161161 /**
162162 * @param mixed $redisAPI The connected Redis API.
0 commit comments