Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit193af22

Browse files
committed
Apply code style suggestions from fabbot
1 parent578a152 commit193af22

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

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

Lines 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 ($hostsas$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 =staticfunction ()use ($class,$params,$dsn,$hosts) {
296298
foreach ($hostsas$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)

[8]ページ先頭

©2009-2025 Movatter.jp