mirror of
https://github.com/predis/predis.git
synced 2026-08-23 12:13:19 +00:00
22 lines
453 B
PHP
22 lines
453 B
PHP
<?php
|
|
|
|
namespace Predis\Options;
|
|
|
|
use Predis\IConnectionFactory;
|
|
use Predis\ConnectionFactory;
|
|
|
|
class ClientConnectionFactory extends Option {
|
|
public function validate($value) {
|
|
if ($value instanceof IConnectionFactory) {
|
|
return $value;
|
|
}
|
|
if (is_array($value)) {
|
|
return new ConnectionFactory($value);
|
|
}
|
|
}
|
|
|
|
public function getDefault() {
|
|
return new ConnectionFactory();
|
|
}
|
|
}
|