ElasticsearchClient   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A getClient() 0 3 1
1
<?php
2
3
namespace Locastic\Loggastic\Bridge\Elasticsearch;
4
5
use Elasticsearch\Client;
6
use Elasticsearch\ClientBuilder;
7
8
final class ElasticsearchClient
9
{
10
    public function __construct(private readonly string $activityLogElasticHost)
11
    {
12
    }
13
14
    public function getClient(): Client
15
    {
16
        return ClientBuilder::create()->setHosts([$this->activityLogElasticHost])->build();
17
    }
18
}
19