Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3.0123 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
47 | 21 | public function handle(SearchClient $client): void |
|
48 | { |
||
49 | 21 | if ($this->searchables->isEmpty()) { |
|
50 | 15 | return; |
|
51 | } |
||
52 | |||
53 | 11 | $index = $client->initIndex($this->searchables->first()->searchableAs()); |
|
54 | |||
55 | 11 | $result = $index->deleteBy([ |
|
56 | 'tagFilters' => [ |
||
57 | $this->searchables->map(function ($searchable) { |
||
58 | 11 | return ObjectIdEncrypter::encrypt($searchable); |
|
59 | 11 | })->toArray(), |
|
60 | ], |
||
61 | ]); |
||
62 | |||
63 | 11 | if (config('scout.synchronous', false)) { |
|
64 | $result->wait(); |
||
65 | } |
||
68 |