Passed
Push — feature/initial-implementation ( fae671...591f29 )
by Fike
02:37
created

Client   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 18
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A indices() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace AmaTeam\ElasticSearch;
4
5
use AmaTeam\ElasticSearch\API\Client\IndexClientInterface;
6
use AmaTeam\ElasticSearch\API\ClientFactoryInterface;
7
use AmaTeam\ElasticSearch\API\ClientInterface;
8
use AmaTeam\ElasticSearch\Client\IndexClient;
9
10
class Client implements ClientInterface
11
{
12
    /**
13
     * @var ClientFactoryInterface
14
     */
15
    private $clientFactory;
16
17
    /**
18
     * @param ClientFactoryInterface $clientFactory
19
     */
20
    public function __construct(ClientFactoryInterface $clientFactory)
21
    {
22
        $this->clientFactory = $clientFactory;
23
    }
24
25
    public function indices(): IndexClientInterface
26
    {
27
        return new IndexClient($this->clientFactory->getClient());
28
    }
29
}
30