| Conditions | 3 |
| Paths | 3 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 3 | public function preCheck(Client $esClient, array $params) |
|
| 30 | { |
||
| 31 | 3 | $index = $params['index']; |
|
| 32 | 3 | if (!$esClient->indices()->exists(['index' => $index])) { |
|
| 33 | 1 | throw new \Exception(sprintf("Index not exist: %s", $index)); |
|
| 34 | } |
||
| 35 | |||
| 36 | 2 | if ($esClient->indices()->existsAlias($params)) { |
|
| 37 | 1 | throw new \Exception(sprintf("Alias already exist: %s", $params['name'])); |
|
| 38 | }; |
||
| 67 |