mirror of
https://github.com/predis/predis.git
synced 2026-10-10 22:07:31 +00:00
Clean up code before fast-forwarding the master branch.
This commit is contained in:
@@ -2,9 +2,12 @@
|
||||
|
||||
namespace Predis\Options;
|
||||
|
||||
use Predis\Distribution\IDistributionStrategy;
|
||||
use Predis\Distribution\HashRing;
|
||||
|
||||
class ClientKeyDistribution extends Option {
|
||||
public function validate($value) {
|
||||
if ($value instanceof \Predis\Distribution\IDistributionStrategy) {
|
||||
if ($value instanceof IDistributionStrategy) {
|
||||
return $value;
|
||||
}
|
||||
if (is_string($value)) {
|
||||
@@ -13,10 +16,10 @@ class ClientKeyDistribution extends Option {
|
||||
return new $value;
|
||||
}
|
||||
}
|
||||
throw new \InvalidArgumentException("Invalid value for key distribution");
|
||||
throw new \InvalidArgumentException('Invalid value for key distribution');
|
||||
}
|
||||
|
||||
public function getDefault() {
|
||||
return new \Predis\Distribution\HashRing();
|
||||
return new HashRing();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user