diff --git a/src/DependencyInjection/SncRedisExtension.php b/src/DependencyInjection/SncRedisExtension.php index 32f5b3fe..f18f02c4 100644 --- a/src/DependencyInjection/SncRedisExtension.php +++ b/src/DependencyInjection/SncRedisExtension.php @@ -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'], $client['options']['replication'])) { + if ($connectionCount === 1 && !isset($client['options']['cluster']) && !isset($client['options']['replication'])) { $clientDef->addArgument(new Reference(sprintf('snc_redis.connection.%s_parameters.%s', $connectionAliases[0], $client['alias']))); } else { $connections = []; diff --git a/tests/DependencyInjection/SncRedisExtensionTest.php b/tests/DependencyInjection/SncRedisExtensionTest.php index 8861d48f..ca241483 100644 --- a/tests/DependencyInjection/SncRedisExtensionTest.php +++ b/tests/DependencyInjection/SncRedisExtensionTest.php @@ -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); - $masterParameters = $container->getDefinition((string) $parameters)->getArgument(0); + $this->assertEquals('snc_redis.connection.default_parameters.default', (string) $parameters[0]); + $masterParameters = $container->getDefinition((string) $parameters[0])->getArgument(0); $this->assertEquals('sentinel', $masterParameters['replication']); $this->assertEquals('mymaster', $masterParameters['service']); $this->assertIsArray($masterParameters['parameters']);