Skip to content

Commit 71e312c

Browse files
committed
Remove static closure declarations
1 parent 517efb1 commit 71e312c

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/Engine.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function delete($models): void
6363
}
6464

6565
$index = $models->first()->searchableAs();
66-
$documentIds = $models->map(static fn (Model $model) => (string) $model->getScoutKey())->all();
66+
$documentIds = $models->map(fn (Model $model) => (string) $model->getScoutKey())->all();
6767

6868
$this->documentManager->delete($index, $documentIds, $this->refreshDocuments);
6969
}
@@ -96,7 +96,7 @@ public function paginate(Builder $builder, $perPage, $page): SearchResponse
9696
*/
9797
public function mapIds($results): BaseCollection
9898
{
99-
return collect($results->hits())->map(static fn (Hit $hit) => $hit->document()->id());
99+
return collect($results->hits())->map(fn (Hit $hit) => $hit->document()->id());
100100
}
101101

102102
/**

src/Factories/DocumentFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class DocumentFactory implements DocumentFactoryInterface
1818
*/
1919
public function makeFromModels(Collection $models): Collection
2020
{
21-
return $models->map(static function (Model $model) {
21+
return $models->map(function (Model $model) {
2222
if (
2323
config('scout.soft_delete', false) &&
2424
in_array(SoftDeletes::class, class_uses_recursive($model), true)

src/Factories/ModelFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function makeLazyFromSearchResponse(SearchResponse $searchResponse, Build
5656
protected function pluckDocumentIds(SearchResponse $searchResponse): array
5757
{
5858
return array_map(
59-
static fn (Hit $hit) => $hit->document()->id(),
59+
fn (Hit $hit) => $hit->document()->id(),
6060
$searchResponse->hits()
6161
);
6262
}
@@ -72,7 +72,7 @@ protected function pluckDocumentIds(SearchResponse $searchResponse): array
7272
*/
7373
protected function filterModels($models, array $documentIds)
7474
{
75-
return $models->filter(static fn (Model $model) => in_array((string) $model->getScoutKey(), $documentIds, true))->values();
75+
return $models->filter(fn (Model $model) => in_array((string) $model->getScoutKey(), $documentIds, true))->values();
7676
}
7777

7878
/**
@@ -88,6 +88,6 @@ protected function sortModels($models, array $documentIds)
8888
{
8989
$documentIdPositions = array_flip($documentIds);
9090

91-
return $models->sortBy(static fn (Model $model) => $documentIdPositions[(string) $model->getScoutKey()])->values();
91+
return $models->sortBy(fn (Model $model) => $documentIdPositions[(string) $model->getScoutKey()])->values();
9292
}
9393
}

0 commit comments

Comments
 (0)