Skip to content

Commit 62d7114

Browse files
author
Arend Hummeling
committed
fix: remove unwanted cast to int
1 parent b4f9da4 commit 62d7114

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

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

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,10 @@ public static function createConnection(string $dsn, array $options = [])
310310
} elseif (is_a($class, \RedisArray::class, true)) {
311311
foreach ($hosts as $i => $host) {
312312
switch ($host['scheme']) {
313-
case 'tcp': $hosts[$i] = $host['host'].':'.$host['port']; break;
314-
case 'tls': $hosts[$i] = 'tls://'.$host['host'].':'.$host['port']; break;
313+
case 'tcp': $hosts[$i] = $host['host'].':'.$host['port'];
314+
break;
315+
case 'tls': $hosts[$i] = 'tls://'.$host['host'].':'.$host['port'];
316+
break;
315317
default: $hosts[$i] = $host['path'];
316318
}
317319
}
@@ -331,8 +333,10 @@ public static function createConnection(string $dsn, array $options = [])
331333
$initializer = static function () use ($class, $params, $hosts) {
332334
foreach ($hosts as $i => $host) {
333335
switch ($host['scheme']) {
334-
case 'tcp': $hosts[$i] = $host['host'].':'.$host['port']; break;
335-
case 'tls': $hosts[$i] = 'tls://'.$host['host'].':'.$host['port']; break;
336+
case 'tcp': $hosts[$i] = $host['host'].':'.$host['port'];
337+
break;
338+
case 'tls': $hosts[$i] = 'tls://'.$host['host'].':'.$host['port'];
339+
break;
336340
default: $hosts[$i] = $host['path'];
337341
}
338342
}
@@ -347,9 +351,12 @@ public static function createConnection(string $dsn, array $options = [])
347351
$redis->setOption(\Redis::OPT_TCP_KEEPALIVE, $params['tcp_keepalive']);
348352
}
349353
switch ($params['failover']) {
350-
case 'error': $redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_ERROR); break;
351-
case 'distribute': $redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_DISTRIBUTE); break;
352-
case 'slaves': $redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_DISTRIBUTE_SLAVES); break;
354+
case 'error': $redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_ERROR);
355+
break;
356+
case 'distribute': $redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_DISTRIBUTE);
357+
break;
358+
case 'slaves': $redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_DISTRIBUTE_SLAVES);
359+
break;
353360
}
354361

355362
return $redis;
@@ -499,7 +506,7 @@ protected function doClear(string $namespace)
499506
}
500507
$this->doDelete($keys);
501508
}
502-
} while ($cursor = (int) $cursor);
509+
} while ($cursor);
503510
}
504511

505512
return $cleared;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy