mirror of
https://github.com/predis/predis.git
synced 2026-10-15 16:26:48 +00:00
Partially rewrite the client options bits and remove some madness.
The concept is now similar to a little dependency-injection system.
This commit is contained in:
@@ -24,13 +24,13 @@ class ClientConnectionFactory extends Option
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function validate($value)
|
||||
public function validate(IClientOptions $options, $value)
|
||||
{
|
||||
if ($value instanceof IConnectionFactory) {
|
||||
return $value;
|
||||
}
|
||||
if (is_array($value)) {
|
||||
$factory = $this->getDefault();
|
||||
$factory = $this->getDefault($options);
|
||||
foreach ($value as $scheme => $initializer) {
|
||||
$factory->define($scheme, $initializer);
|
||||
}
|
||||
@@ -41,7 +41,7 @@ class ClientConnectionFactory extends Option
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getDefault()
|
||||
public function getDefault(IClientOptions $options)
|
||||
{
|
||||
return new ConnectionFactory();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user