| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | 1 | public static function create(string $host, string $port, string $index): ApiService |
|
| 11 | { |
||
| 12 | 1 | $client = ClientBuilder::create() |
|
| 13 | 1 | ->setSerializer(new JsonSerializer()) |
|
| 14 | 1 | ->setHosts(["$host:$port"]) |
|
| 15 | 1 | ->build(); |
|
| 16 | |||
| 17 | 1 | $elasticApi = new ElasticApi($client); |
|
| 18 | |||
| 19 | 1 | return new ApiService( |
|
| 20 | $elasticApi, |
||
| 21 | $index |
||
| 22 | ); |
||
| 23 | } |
||
| 24 | } |
||
| 25 |