@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @return PhpRedisConnection The Sentinel connection containing a configured |
58 | 58 | * PhpRedis Client |
59 | 59 | */ |
60 | - public function connect(array $servers, array $options = [ ]) |
|
60 | + public function connect(array $servers, array $options = []) |
|
61 | 61 | { |
62 | 62 | // Set the initial Sentinel servers. |
63 | 63 | $this->servers = array_map(function ($server) { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | // Merge the global options shared by all Sentinel connections with |
68 | 68 | // connection-specific options |
69 | - $clientOpts = array_merge($options, Arr::pull($servers, 'options', [ ])); |
|
69 | + $clientOpts = array_merge($options, Arr::pull($servers, 'options', [])); |
|
70 | 70 | |
71 | 71 | // Extract the array of Sentinel connection options from the rest of |
72 | 72 | // the client options |
@@ -106,12 +106,12 @@ discard block |
||
106 | 106 | shuffle($servers); |
107 | 107 | |
108 | 108 | // Check if the redis extension is enabled. |
109 | - if (! extension_loaded('redis')) { |
|
109 | + if (!extension_loaded('redis')) { |
|
110 | 110 | throw new LogicException('Please make sure the PHP Redis extension is installed and enabled.'); |
111 | 111 | } |
112 | 112 | |
113 | 113 | // Check if the extension is up to date and contains RedisSentinel. |
114 | - if (! class_exists(RedisSentinel::class)) { |
|
114 | + if (!class_exists(RedisSentinel::class)) { |
|
115 | 115 | throw new LogicException('Please make sure the PHP Redis extension is up to date.'); |
116 | 116 | } |
117 | 117 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | // Lookup the master node. |
135 | 135 | $master = $sentinel->getMasterAddrByName($service); |
136 | - if (is_array($master) && ! count($master)) { |
|
136 | + if (is_array($master) && !count($master)) { |
|
137 | 137 | throw new RedisException(sprintf('No master found for service "%s".', $service)); |
138 | 138 | } |
139 | 139 | |
@@ -188,14 +188,14 @@ discard block |
||
188 | 188 | { |
189 | 189 | if (is_string($server)) { |
190 | 190 | list($host, $port) = explode(':', $server); |
191 | - if (! $host || ! $port) { |
|
191 | + if (!$host || !$port) { |
|
192 | 192 | throw new RedisException('Could not format the server definition.'); |
193 | 193 | } |
194 | 194 | |
195 | 195 | return ['host' => $host, 'port' => (int) $port]; |
196 | 196 | } |
197 | 197 | |
198 | - if (! is_array($server)) { |
|
198 | + if (!is_array($server)) { |
|
199 | 199 | throw new RedisException('Could not format the server definition.'); |
200 | 200 | } |
201 | 201 |