Swap params order in redis-sentinel constructor.

This commit is contained in:
Daniele Alessandri
2016-05-21 15:23:24 +02:00
parent d6d307696a
commit c1de65c4ee
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ class ReplicationOption implements OptionInterface
if ($value === 'sentinel') {
return function ($sentinels, $options) {
return new SentinelReplication($sentinels, $options->service, $options->connections);
return new SentinelReplication($options->service, $sentinels, $options->connections);
};
}
@@ -101,14 +101,14 @@ class SentinelReplication implements ReplicationInterface
protected $updateSentinels = false;
/**
* @param array $sentinels Sentinel servers connection parameters.
* @param string $service Name of the service for autodiscovery.
* @param array $sentinels Sentinel servers connection parameters.
* @param ConnectionFactoryInterface $connectionFactory Connection factory instance.
* @param ReplicationStrategy $strategy Replication strategy instance.
*/
public function __construct(
array $sentinels,
$service,
array $sentinels,
ConnectionFactoryInterface $connectionFactory,
ReplicationStrategy $strategy = null
) {
@@ -1040,7 +1040,7 @@ class SentinelReplicationTest extends PredisTestCase
$factory = new Connection\Factory();
$replication = new SentinelReplication(
array('tcp://127.0.0.1:5381?alias=sentinel1'), 'svc', $factory, $strategy
'svc', array('tcp://127.0.0.1:5381?alias=sentinel1'), $factory, $strategy
);
$this->assertSame($strategy, $replication->getReplicationStrategy());
@@ -1060,7 +1060,7 @@ class SentinelReplicationTest extends PredisTestCase
$strategy = new Replication\ReplicationStrategy();
$factory = new Connection\Factory();
$replication = new SentinelReplication(array($sentinel1), 'svc', $factory, $strategy);
$replication = new SentinelReplication('svc', array($sentinel1), $factory, $strategy);
$replication->add($master);
$replication->add($slave1);
@@ -1091,7 +1091,7 @@ class SentinelReplicationTest extends PredisTestCase
{
$factory = $factory ?: new Connection\Factory();
$replication = new SentinelReplication($sentinels, $service, $factory);
$replication = new SentinelReplication($service, $sentinels, $factory);
$replication->setRetryWait(0);
return $replication;