@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * Create a new Redis Sentinel connection from the provided configuration |
| 82 | 82 | * options |
| 83 | 83 | * |
| 84 | - * @param array $server The client configuration for the connection |
|
| 84 | + * @param array $servers The client configuration for the connection |
|
| 85 | 85 | * @param array $options The global client options shared by all Sentinel |
| 86 | 86 | * connections |
| 87 | 87 | * |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | * @param int $retryLimit The number of times the retry is performed. |
| 249 | 249 | * @param int $retryWait The time in milliseconds to wait before retrying again. |
| 250 | 250 | * @param callable $failureCallback The operation to execute when a failure happens. |
| 251 | - * @return mixed The result of the first successful attempt. |
|
| 251 | + * @return null|callable The result of the first successful attempt. |
|
| 252 | 252 | * |
| 253 | 253 | * @throws RedisRetryException After exhausting the allowed number of |
| 254 | 254 | * attempts to connect. |
@@ -68,11 +68,11 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function __construct() |
| 70 | 70 | { |
| 71 | - if (! extension_loaded('redis')) { |
|
| 71 | + if (!extension_loaded('redis')) { |
|
| 72 | 72 | throw new LogicException('Please make sure the PHP Redis extension is installed and enabled.'); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - if (! class_exists(RedisSentinel::class)) { |
|
| 75 | + if (!class_exists(RedisSentinel::class)) { |
|
| 76 | 76 | throw new LogicException('Please make sure the PHP Redis extension is up to date (5.3.4 or greater).'); |
| 77 | 77 | } |
| 78 | 78 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | * @return PhpRedisConnection The Sentinel connection containing a configured |
| 89 | 89 | * PhpRedis Client |
| 90 | 90 | */ |
| 91 | - public function connect(array $servers, array $options = [ ]) |
|
| 91 | + public function connect(array $servers, array $options = []) |
|
| 92 | 92 | { |
| 93 | 93 | // Set the initial Sentinel servers. |
| 94 | 94 | $this->servers = array_map(function ($server) { |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | // Merge the global options shared by all Sentinel connections with |
| 109 | 109 | // connection-specific options |
| 110 | - $clientOpts = array_merge($options, Arr::pull($servers, 'options', [ ])); |
|
| 110 | + $clientOpts = array_merge($options, Arr::pull($servers, 'options', [])); |
|
| 111 | 111 | |
| 112 | 112 | // Extract the array of Sentinel connection options from the rest of |
| 113 | 113 | // the client options |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | // Lookup the master node. |
| 173 | 173 | $master = $sentinel->getMasterAddrByName($sentinelService); |
| 174 | - if (is_array($master) && ! count($master)) { |
|
| 174 | + if (is_array($master) && !count($master)) { |
|
| 175 | 175 | throw new RedisException(sprintf('No master found for service "%s".', $sentinelService)); |
| 176 | 176 | } |
| 177 | 177 | |
@@ -227,14 +227,14 @@ discard block |
||
| 227 | 227 | { |
| 228 | 228 | if (is_string($server)) { |
| 229 | 229 | list($host, $port) = explode(':', $server); |
| 230 | - if (! $host || ! $port) { |
|
| 230 | + if (!$host || !$port) { |
|
| 231 | 231 | throw new RedisException('Could not format the server definition.'); |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | return ['host' => $host, 'port' => (int) $port]; |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | - if (! is_array($server)) { |
|
| 237 | + if (!is_array($server)) { |
|
| 238 | 238 | throw new RedisException('Could not format the server definition.'); |
| 239 | 239 | } |
| 240 | 240 | |