Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: snc/SncRedisBundle
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.4.0
Choose a base ref
...
head repository: snc/SncRedisBundle
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4.4.1
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on Dec 10, 2022

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    ostrolucky Gabriel Ostrolucký
    Copy the full SHA
    9e6b111 View commit details
  2. Update CI matrix

    ostrolucky committed Dec 10, 2022

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    ostrolucky Gabriel Ostrolucký
    Copy the full SHA
    feec42e View commit details
12 changes: 6 additions & 6 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -28,16 +28,16 @@ jobs:
php-version: "7.4"
php-extensions: "redis-5.3.0"
- symfony-require: "4.4.*"
php-version: "8.0"
php-version: "8.1"
php-extensions: "redis"
- symfony-require: "5.4.*"
php-version: "8.0"
php-extensions: "redis"
- symfony-require: "6.1.*"
php-version: "8.1"
php-version: "8.2"
php-extensions: "redis"
- symfony-require: "6.2.*"
php-version: "8.1"
php-version: "8.2"
php-extensions: "redis"
- symfony-require: "6.3.*"
php-version: "8.2"
php-extensions: "redis-phpredis/phpredis@develop"

steps:
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration/Configuration.php
Original file line number Diff line number Diff line change
@@ -126,7 +126,7 @@ private function addClientsSection(ArrayNodeDefinition $rootNode): void
->scalarNode('profile')->defaultValue('default')->end()
->scalarNode('cluster')->defaultNull()->end()
->scalarNode('prefix')->defaultNull()->end()
->enumNode('replication')->values([true, false, 'sentinel'])->defaultValue(false)->end()
->enumNode('replication')->values([true, 'sentinel'])->end()
->scalarNode('service')->defaultNull()->end()
->enumNode('slave_failover')->values(['none', 'error', 'distribute', 'distribute_slaves'])->end()
->arrayNode('parameters')
4 changes: 2 additions & 2 deletions src/DependencyInjection/SncRedisExtension.php
Original file line number Diff line number Diff line change
@@ -190,7 +190,7 @@ private function loadPredisClient(array $client, ContainerBuilder $container): v
$container->setDefinition($optionId, $optionDef);
$clientDef = new Definition((string) $container->getParameter('snc_redis.client.class'));
$clientDef->addTag('snc_redis.client', ['alias' => $client['alias']]);
if ($connectionCount === 1 && !isset($client['options']['cluster']) && !isset($client['options']['replication'])) {
if ($connectionCount === 1 && !isset($client['options']['cluster'], $client['options']['replication'])) {
$clientDef->addArgument(new Reference(sprintf('snc_redis.connection.%s_parameters.%s', $connectionAliases[0], $client['alias'])));
} else {
$connections = [];
@@ -228,7 +228,7 @@ private function loadPhpredisClient(array $options, ContainerBuilder $container)
{
$connectionCount = count($options['dsns']);
$hasClusterOption = $options['options']['cluster'] !== null;
$hasSentinelOption = (bool) $options['options']['replication'];
$hasSentinelOption = isset($options['options']['replication']);

if ($connectionCount > 1 && !$hasClusterOption && !$hasSentinelOption) {
throw new LogicException('Use options "cluster" or "sentinel" to enable support for multi DSN instances.');
5 changes: 0 additions & 5 deletions tests/DependencyInjection/SncRedisExtensionEnvTest.php
Original file line number Diff line number Diff line change
@@ -64,7 +64,6 @@ public function testPhpredisDefaultParameterConfig(): void
'profile' => 'default',
'cluster' => null,
'prefix' => null,
'replication' => false,
'service' => null,
],
$clientDefinition->getArgument(2),
@@ -104,7 +103,6 @@ public function testPhpredisFullConfig(): void
'throw_errors' => true,
'profile' => 'default',
'cluster' => null,
'replication' => false,
'service' => null,
],
$clientDefinition->getArgument(2),
@@ -143,7 +141,6 @@ public function testPhpredisWithAclConfig(): void
'serialization' => 'php',
'service' => null,
'throw_errors' => true,
'replication' => null,
],
$clientDefinition->getArgument(2),
);
@@ -196,7 +193,6 @@ public function testPhpRedisClusterOption(): void
'serialization' => 'default',
'profile' => 'default',
'prefix' => null,
'replication' => false,
'service' => null,
],
$clientDefinition->getArgument(2),
@@ -257,7 +253,6 @@ public function testPhpRedisClusterOptionMultipleDsn(): void
'serialization' => 'default',
'profile' => 'default',
'prefix' => null,
'replication' => false,
'service' => null,
],
$clientDefinition->getArgument(2),
4 changes: 2 additions & 2 deletions tests/DependencyInjection/SncRedisExtensionTest.php
Original file line number Diff line number Diff line change
@@ -338,8 +338,8 @@ public function testSingleSentinelOption(): void
$this->assertEquals('sentinel', $options['replication']);
$this->assertEquals('mymaster', $options['service']);
$parameters = $container->getDefinition('snc_redis.default')->getArgument(0);
$this->assertEquals('snc_redis.connection.default_parameters.default', (string) $parameters[0]);
$masterParameters = $container->getDefinition((string) $parameters[0])->getArgument(0);
$this->assertEquals('snc_redis.connection.default_parameters.default', (string) $parameters);
$masterParameters = $container->getDefinition((string) $parameters)->getArgument(0);
$this->assertEquals('sentinel', $masterParameters['replication']);
$this->assertEquals('mymaster', $masterParameters['service']);
$this->assertIsArray($masterParameters['parameters']);