22
33namespace malkusch \lock \mutex ;
44
5- use Predis \Client ;
5+ use Predis \ClientInterface ;
66use Predis \PredisException ;
77use malkusch \lock \exception \LockAcquireException ;
88use malkusch \lock \exception \LockReleaseException ;
@@ -22,7 +22,7 @@ class PredisMutex extends RedisMutex
2222 /**
2323 * Sets the Redis connections.
2424 *
25- * @param Client [] $clients The Redis clients.
25+ * @param ClientInterface [] $clients The Redis clients.
2626 * @param string $name The lock name.
2727 * @param int $timeout The time in seconds a lock expires, default is 3.
2828 *
@@ -38,6 +38,7 @@ public function __construct(array $clients, $name, $timeout = 3)
3838 */
3939 protected function add ($ client , $ key , $ value , $ expire )
4040 {
41+ /** @var ClientInterface $client */
4142 try {
4243 return $ client ->set ($ key , $ value , "EX " , $ expire , "NX " );
4344 } catch (PredisException $ e ) {
@@ -55,6 +56,7 @@ protected function add($client, $key, $value, $expire)
5556 */
5657 protected function evalScript ($ client , $ script , $ numkeys , array $ arguments )
5758 {
59+ /** @var ClientInterface $client */
5860 try {
5961 return $ client ->eval (...array_merge ([$ script , $ numkeys ], $ arguments ));
6062 } catch (PredisException $ e ) {
@@ -71,6 +73,7 @@ protected function evalScript($client, $script, $numkeys, array $arguments)
7173 */
7274 protected function getRedisIdentifier ($ client )
7375 {
76+ /** @var ClientInterface $client */
7477 return (string ) $ client ->getConnection ();
7578 }
7679}
0 commit comments