Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
39 | 1 | public function update(string $type, array $body, string $id = null): array |
|
40 | { |
||
41 | $params = [ |
||
42 | 1 | 'index' => $this->index, |
|
43 | 1 | 'type' => $type, |
|
44 | 'refresh' => true, |
||
45 | 1 | 'body' => $body, |
|
46 | ]; |
||
47 | |||
48 | 1 | if ($id !== null) { |
|
49 | 1 | $params['id'] = $id; |
|
50 | } |
||
51 | |||
52 | 1 | return $this->client->index($params); |
|
53 | } |
||
54 | } |
||
55 |