Conditions | 3 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
43 | 1 | public function handle($clientId, $indexId) |
|
44 | { |
||
45 | 1 | $client = $this->clientRepository->get($clientId); |
|
46 | 1 | $config = $this->configurationRepository->get($clientId, $indexId); |
|
47 | |||
48 | 1 | if (null == $client || null == $config) { |
|
49 | 1 | throw new \InvalidArgumentException(); |
|
50 | } |
||
51 | |||
52 | $client |
||
53 | 1 | ->indices() |
|
54 | 1 | ->create([ |
|
55 | 1 | 'index' => $indexId, |
|
56 | 1 | 'body' => $config, |
|
57 | 1 | ]) |
|
58 | ; |
||
59 | } |
||
60 | } |