From 513015fe5e58d5b5e3c1dded854b8ade760b4169 Mon Sep 17 00:00:00 2001 From: Ivan Babenko Date: Tue, 24 Mar 2020 16:11:06 +0100 Subject: [PATCH] Apply fixes from StyleCI (#352) --- src/Indexers/BulkIndexer.php | 2 +- src/Indexers/SingleIndexer.php | 3 +-- tests/Indexers/SingleIndexerTest.php | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Indexers/BulkIndexer.php b/src/Indexers/BulkIndexer.php index 930f7cf..853d70e 100644 --- a/src/Indexers/BulkIndexer.php +++ b/src/Indexers/BulkIndexer.php @@ -71,7 +71,7 @@ public function delete(Collection $models) if ($documentRefresh = config('scout_elastic.document_refresh')) { $bulkPayload->set('refresh', $documentRefresh); - } + } $bulkPayload->set('client.ignore', 404); diff --git a/src/Indexers/SingleIndexer.php b/src/Indexers/SingleIndexer.php index 0e99ddd..285f510 100644 --- a/src/Indexers/SingleIndexer.php +++ b/src/Indexers/SingleIndexer.php @@ -53,11 +53,10 @@ public function delete(Collection $models) $models->each(function ($model) { $payload = new DocumentPayload($model); - if ($documentRefresh = config('scout_elastic.document_refresh')) { $payload->set('refresh', $documentRefresh); } - + $payload->set('client.ignore', 404); ElasticClient::delete($payload->get()); diff --git a/tests/Indexers/SingleIndexerTest.php b/tests/Indexers/SingleIndexerTest.php index e91ec17..968243e 100644 --- a/tests/Indexers/SingleIndexerTest.php +++ b/tests/Indexers/SingleIndexerTest.php @@ -197,9 +197,9 @@ public function testDeleteWithSpecifiedDocumentRefreshOption() ], ]); - (new SingleIndexer()) + (new SingleIndexer()) ->delete($this->models); - $this->addToAssertionCount(1); + $this->addToAssertionCount(1); } }