| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | 9 | public function handle(Client $elasticsearch): void |
|
| 38 | { |
||
| 39 | /** @var Searchable $searchable */ |
||
| 40 | 9 | $searchable = $this->searchable; |
|
| 41 | 9 | $this->index->addAlias(new WriteAlias(new DefaultAlias($searchable->searchableAs()))); |
|
| 42 | |||
| 43 | 9 | $params = new Create( |
|
| 44 | 9 | $this->index->name(), |
|
| 45 | 9 | $this->index->config() |
|
| 46 | ); |
||
| 47 | |||
| 48 | 9 | $elasticsearch->indices()->create($params->toArray()); |
|
| 49 | 9 | } |
|
| 61 |