Skip to content

Commit

Permalink
ci: fix (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbond authored Dec 1, 2022
1 parent 905fde9 commit f0b65a8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.0, 8.1]
deps: [hightest]
php: [8.0, 8.1, 8.2]
deps: [highest]
include:
- php: 8.0
deps: lowest
Expand Down Expand Up @@ -98,5 +98,3 @@ jobs:

sca:
uses: zenstruck/.github/.github/workflows/php-stan.yml@main
with:
php: 8.1
3 changes: 2 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
'remove_inheritdoc' => true,
],
'phpdoc_to_comment' => false,
'function_declaration' => ['closure_function_spacing' => 'none'],
'function_declaration' => ['closure_function_spacing' => 'none', 'closure_fn_spacing' => 'none'],
'nullable_type_declaration_for_default_null_value' => true,
'phpdoc_types_order' => ['null_adjustment' => 'none', 'sort_algorithm' => 'none'],
'phpdoc_separation' => false,
])
->setRiskyAllowed(true)
->setFinder($finder)
Expand Down
12 changes: 9 additions & 3 deletions src/Redis/DsnFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,15 @@ public function __invoke(): \Redis|\RedisArray|\RedisCluster
}

switch ($params['failover']) {
case 'error': $redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_ERROR); break;
case 'distribute': $redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_DISTRIBUTE); break;
case 'slaves': $redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_DISTRIBUTE_SLAVES); break;
case 'error':
$redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_ERROR);
break;
case 'distribute':
$redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_DISTRIBUTE);
break;
case 'slaves':
$redis->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, \RedisCluster::FAILOVER_DISTRIBUTE_SLAVES);
break;
}

return self::configureClient($redis, $params);
Expand Down
12 changes: 10 additions & 2 deletions tests/RedisProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,17 @@ public static function redisSerializerProvider(): \Traversable
{
foreach (self::redisDsnProvider() as [$dsn, $class]) {
yield [Redis::create($dsn, ['serializer' => 'php']), \Redis::SERIALIZER_PHP, $class];
yield [Redis::create($dsn, ['serializer' => 'igbinary']), \Redis::SERIALIZER_IGBINARY, $class];

if (\defined('Redis::SERIALIZER_IGBINARY')) {
yield [Redis::create($dsn, ['serializer' => 'igbinary']), \Redis::SERIALIZER_IGBINARY, $class];
}

yield [Redis::create($dsn, ['serializer' => \Redis::SERIALIZER_PHP]), \Redis::SERIALIZER_PHP, $class];
yield [Redis::create($dsn, ['serializer' => \Redis::SERIALIZER_IGBINARY]), \Redis::SERIALIZER_IGBINARY, $class];

if (\defined('Redis::SERIALIZER_IGBINARY')) {
yield [Redis::create($dsn, ['serializer' => \Redis::SERIALIZER_IGBINARY]), \Redis::SERIALIZER_IGBINARY, $class];
}

yield [Redis::create($dsn, ['serializer' => 'json']), \Redis::SERIALIZER_JSON, $class];
yield [Redis::create($dsn, ['serializer' => \Redis::SERIALIZER_JSON]), \Redis::SERIALIZER_JSON, $class];
}
Expand Down

0 comments on commit f0b65a8

Please sign in to comment.