Skip to content

Commit 921404e

Browse files
authored
Call RedisSentinel constructor with auth arg only if set (#27)
1 parent 6f91478 commit 921404e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Connectors/PhpRedisSentinelConnector.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ private function connectToSentinel(array $config): RedisSentinel
120120
return new RedisSentinel($options);
121121
}
122122

123-
/** @noinspection PhpMethodParametersCountMismatchInspection */
124-
return new RedisSentinel($host, $port, $timeout, $persistent, $retryInterval, $readTimeout, $auth);
123+
if ($auth !== null) {
124+
/** @noinspection PhpMethodParametersCountMismatchInspection */
125+
return new RedisSentinel($host, $port, $timeout, $persistent, $retryInterval, $readTimeout, $auth);
126+
}
127+
128+
return new RedisSentinel($host, $port, $timeout, $persistent, $retryInterval, $readTimeout);
125129
}
126130
}

0 commit comments

Comments
 (0)