Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bd789ca

Browse filesBrowse files
committed
Apply code style suggestions from fabbot
1 parent 578a152 commit bd789ca
Copy full SHA for bd789ca

File tree

1 file changed

+14
-7
lines changed
Filter options

1 file changed

+14
-7
lines changed

‎src/Symfony/Component/Cache/Traits/RedisTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Traits/RedisTrait.php
+14-7Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,10 @@ public static function createConnection(string $dsn, array $options = [])
274274
} elseif (is_a($class, \RedisArray::class, true)) {
275275
foreach ($hosts as $i => $host) {
276276
switch ($host['scheme']) {
277-
case 'tcp': $hosts[$i] = $host['host'].':'.$host['port']; break;
278-
case 'tls': $hosts[$i] = 'tls://'.$host['host'].':'.$host['port']; break;
277+
case 'tcp': $hosts[$i] = $host['host'].':'.$host['port'];
278+
break;
279+
case 'tls': $hosts[$i] = 'tls://'.$host['host'].':'.$host['port'];
280+
break;
279281
default: $hosts[$i] = $host['path'];
280282
}
281283
}
@@ -295,8 +297,10 @@ public static function createConnection(string $dsn, array $options = [])
295297
$initializer = static function () use ($class, $params, $dsn, $hosts) {
296298
foreach ($hosts as $i => $host) {
297299
switch ($host['scheme']) {
298-
case 'tcp': $hosts[$i] = $host['host'].':'.$host['port']; break;
299-
case 'tls': $hosts[$i] = 'tls://'.$host['host'].':'.$host['port']; break;
300+
case 'tcp': $hosts[$i] = $host['host'].':'.$host['port'];
301+
break;
302+
case 'tls': $hosts[$i] = 'tls://'.$host['host'].':'.$host['port'];
303+
break;
300304
default: $hosts[$i] = $host['path'];
301305
}
302306
}
@@ -311,9 +315,12 @@ public static function createConnection(string $dsn, array $options = [])
311315
$redis->setOption(\Redis::OPT_TCP_KEEPALIVE, $params['tcp_keepalive']);
312316
}
313317
switch ($params['failover']) {
314-
case 'error': $redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_ERROR); break;
315-
case 'distribute': $redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_DISTRIBUTE); break;
316-
case 'slaves': $redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_DISTRIBUTE_SLAVES); break;
318+
case 'error': $redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_ERROR);
319+
break;
320+
case 'distribute': $redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_DISTRIBUTE);
321+
break;
322+
case 'slaves': $redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_DISTRIBUTE_SLAVES);
323+
break;
317324
}
318325

319326
return $redis;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.