Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2.003 |
Changes | 0 |
1 | <?php |
||
34 | public function handle(Client $client, $index, $type) |
||
35 | { |
||
36 | 1 | $config = $this->configurationRepository->get($index); |
|
37 | |||
38 | 1 | if ($this->isInvalid($config, $type)) { |
|
39 | throw new \InvalidArgumentException(); |
||
40 | } |
||
41 | |||
42 | $client |
||
43 | 1 | ->indices() |
|
44 | 1 | ->putMapping([ |
|
45 | 1 | 'index' => $index, |
|
46 | 1 | 'type' => $type, |
|
47 | 'body' => [ |
||
48 | 1 | $type => $config['mappings'][$type], |
|
49 | 1 | ], |
|
50 | 1 | ]) |
|
51 | ; |
||
52 | 1 | } |
|
53 | |||
63 |