@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | $this->driver = new Credis_Client($host, $port, $timeout, $persistent); |
135 | 135 | $this->driver->setMaxConnectRetries($maxRetries); |
136 | - if ($password){ |
|
136 | + if ($password) { |
|
137 | 137 | $this->driver->auth($password); |
138 | 138 | } |
139 | 139 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $this->driver->select($database); |
149 | 149 | } |
150 | 150 | } |
151 | - catch(CredisException $e) { |
|
151 | + catch (CredisException $e) { |
|
152 | 152 | throw new Resque_RedisException('Error communicating with Redis: ' . $e->getMessage(), 0, $e); |
153 | 153 | } |
154 | 154 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | // Use a sensible default for an empty DNS string |
174 | 174 | $dsn = 'redis://' . self::DEFAULT_HOST; |
175 | 175 | } |
176 | - if(substr($dsn, 0, 7) === 'unix://') { |
|
176 | + if (substr($dsn, 0, 7) === 'unix://') { |
|
177 | 177 | return array( |
178 | 178 | $dsn, |
179 | 179 | null, |
@@ -187,12 +187,12 @@ discard block |
||
187 | 187 | |
188 | 188 | // Check the URI scheme |
189 | 189 | $validSchemes = array('redis', 'tcp'); |
190 | - if (isset($parts['scheme']) && ! in_array($parts['scheme'], $validSchemes)) { |
|
190 | + if (isset($parts['scheme']) && !in_array($parts['scheme'], $validSchemes)) { |
|
191 | 191 | throw new \InvalidArgumentException("Invalid DSN. Supported schemes are " . implode(', ', $validSchemes)); |
192 | 192 | } |
193 | 193 | |
194 | 194 | // Allow simple 'hostname' format, which `parse_url` treats as a path, not host. |
195 | - if ( ! isset($parts['host']) && isset($parts['path'])) { |
|
195 | + if (!isset($parts['host']) && isset($parts['path'])) { |
|
196 | 196 | $parts['host'] = $parts['path']; |
197 | 197 | unset($parts['path']); |
198 | 198 | } |
@@ -218,15 +218,15 @@ discard block |
||
218 | 218 | } |
219 | 219 | |
220 | 220 | //check 'password-encoding' parameter and extracting password based on encoding |
221 | - if($options && isset($options['password-encoding']) && $options['password-encoding'] === 'u'){ |
|
221 | + if ($options && isset($options['password-encoding']) && $options['password-encoding'] === 'u') { |
|
222 | 222 | //extracting urlencoded password |
223 | 223 | $pass = isset($parts['pass']) ? urldecode($parts['pass']) : false; |
224 | 224 | } |
225 | - else if($options && isset($options['password-encoding']) && $options['password-encoding'] === 'b'){ |
|
225 | + else if ($options && isset($options['password-encoding']) && $options['password-encoding'] === 'b') { |
|
226 | 226 | //extracting base64 encoded password |
227 | 227 | $pass = isset($parts['pass']) ? base64_decode($parts['pass']) : false; |
228 | 228 | } |
229 | - else{ |
|
229 | + else { |
|
230 | 230 | //extracting pass directly since 'password-encoding' parameter is not present |
231 | 231 | $pass = isset($parts['pass']) ? $parts['pass'] : false; |
232 | 232 | } |
@@ -276,10 +276,10 @@ discard block |
||
276 | 276 | |
277 | 277 | public static function removePrefix($string) |
278 | 278 | { |
279 | - $prefix=self::getPrefix(); |
|
279 | + $prefix = self::getPrefix(); |
|
280 | 280 | |
281 | 281 | if (substr($string, 0, strlen($prefix)) == $prefix) { |
282 | - $string = substr($string, strlen($prefix), strlen($string) ); |
|
282 | + $string = substr($string, strlen($prefix), strlen($string)); |
|
283 | 283 | } |
284 | 284 | return $string; |
285 | 285 | } |