| Total Complexity | 4 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class DefaultClientFactory implements ClientFactoryInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var string[] |
||
| 14 | */ |
||
| 15 | private $hosts; |
||
| 16 | /** |
||
| 17 | * @var LoggerInterface |
||
| 18 | */ |
||
| 19 | private $logger; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param string[] $hosts |
||
| 23 | */ |
||
| 24 | public function __construct($hosts = ['localhost:9200']) |
||
| 25 | { |
||
| 26 | $this->hosts = $hosts; |
||
| 27 | $this->logger = new NullLogger(); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function getClient(): Client |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param string[] $hosts |
||
| 37 | * @return DefaultClientFactory |
||
| 38 | */ |
||
| 39 | public function setHosts(string ...$hosts): DefaultClientFactory |
||
| 40 | { |
||
| 41 | $this->hosts = $hosts; |
||
| 42 | return $this; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @param LoggerInterface $logger |
||
| 47 | * @return DefaultClientFactory |
||
| 48 | */ |
||
| 49 | public function setLogger(LoggerInterface $logger): DefaultClientFactory |
||
| 53 | } |
||
| 54 | } |
||
| 55 |