Rename method "enableAutoSlotsMap()" to "useClusterSlots()".

This commit is contained in:
Daniele Alessandri
2014-07-21 14:38:20 +02:00
parent 9213f02da8
commit 346986099d
2 changed files with 10 additions and 10 deletions
+4 -4
View File
@@ -49,7 +49,7 @@ use Predis\Response\ErrorInterface as ErrorResponseInterface;
*/
class RedisCluster implements ClusterInterface, IteratorAggregate, Countable
{
private $askSlotsMap = true;
private $useClusterSlots = true;
private $defaultParameters = array();
private $pool = array();
private $slots = array();
@@ -409,7 +409,7 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable
$connection = $this->createConnection($connectionID);
}
if ($this->askSlotsMap) {
if ($this->useClusterSlots) {
$this->askSlotsMap($connection);
}
@@ -523,9 +523,9 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable
*
* @param bool $value Enable or disable the use of CLUSTER SLOTS.
*/
public function enableAutoSlotsMap($value)
public function useClusterSlots($value)
{
$this->askSlotsMap = (bool) $value;
$this->useClusterSlots = (bool) $value;
}
/**
@@ -422,7 +422,7 @@ class RedisClusterTest extends PredisTestCase
$connection2->expects($this->never())->method('writeRequest');
$cluster = new RedisCluster();
$cluster->enableAutoSlotsMap(false);
$cluster->useClusterSlots(false);
$cluster->add($connection1);
$cluster->add($connection2);
@@ -443,7 +443,7 @@ class RedisClusterTest extends PredisTestCase
$connection2->expects($this->once())->method('readResponse')->with($command);
$cluster = new RedisCluster();
$cluster->enableAutoSlotsMap(false);
$cluster->useClusterSlots(false);
$cluster->add($connection1);
$cluster->add($connection2);
@@ -503,7 +503,7 @@ class RedisClusterTest extends PredisTestCase
$factory->expects($this->never())->method('create');
$cluster = new RedisCluster($factory);
$cluster->enableAutoSlotsMap(false);
$cluster->useClusterSlots(false);
$cluster->add($connection1);
$cluster->add($connection2);
@@ -547,7 +547,7 @@ class RedisClusterTest extends PredisTestCase
->will($this->returnValue($connection3));
$cluster = new RedisCluster($factory);
$cluster->enableAutoSlotsMap(false);
$cluster->useClusterSlots(false);
$cluster->add($connection1);
$cluster->add($connection2);
@@ -581,7 +581,7 @@ class RedisClusterTest extends PredisTestCase
$factory->expects($this->never())->method('create');
$cluster = new RedisCluster($factory);
$cluster->enableAutoSlotsMap(false);
$cluster->useClusterSlots(false);
$cluster->add($connection1);
$cluster->add($connection2);
@@ -622,7 +622,7 @@ class RedisClusterTest extends PredisTestCase
->will($this->returnValue($connection3));
$cluster = new RedisCluster($factory);
$cluster->enableAutoSlotsMap(false);
$cluster->useClusterSlots(false);
$cluster->add($connection1);
$cluster->add($connection2);