@@ -310,8 +310,10 @@ public static function createConnection(string $dsn, array $options = [])
310
310
} elseif (is_a ($ class , \RedisArray::class, true )) {
311
311
foreach ($ hosts as $ i => $ host ) {
312
312
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 ;
315
317
default : $ hosts [$ i ] = $ host ['path ' ];
316
318
}
317
319
}
@@ -331,8 +333,10 @@ public static function createConnection(string $dsn, array $options = [])
331
333
$ initializer = static function () use ($ class , $ params , $ hosts ) {
332
334
foreach ($ hosts as $ i => $ host ) {
333
335
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 ;
336
340
default : $ hosts [$ i ] = $ host ['path ' ];
337
341
}
338
342
}
@@ -347,9 +351,12 @@ public static function createConnection(string $dsn, array $options = [])
347
351
$ redis ->setOption (\Redis::OPT_TCP_KEEPALIVE , $ params ['tcp_keepalive ' ]);
348
352
}
349
353
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 ;
353
360
}
354
361
355
362
return $ redis ;
@@ -499,7 +506,7 @@ protected function doClear(string $namespace)
499
506
}
500
507
$ this ->doDelete ($ keys );
501
508
}
502
- } while ($ cursor = ( int ) $ cursor );
509
+ } while ($ cursor );
503
510
}
504
511
505
512
return $ cleared ;
0 commit comments