Skip to content

Commit 5202054

Browse files
committed
ECS Fixes
Signed-off-by: Jan Henckens <jan@henckens.be>
1 parent b9adbd8 commit 5202054

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/behaviors/SearchableBehavior.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,20 @@ public function getIndices(): Collection
6262
return Scout::$plugin
6363
->getSettings()
6464
->getIndices()
65-
->filter(function (ScoutIndex $scoutIndex) {
65+
->filter(function(ScoutIndex $scoutIndex) {
6666
if ($scoutIndex->replicaIndex) {
6767
return false;
6868
}
6969
if (is_array($scoutIndex->criteria)) {
70-
$criteriaSiteIds = collect($scoutIndex->criteria)->map(function ($criteria) {
70+
$criteriaSiteIds = collect($scoutIndex->criteria)->map(function($criteria) {
7171
return Arr::wrap($criteria->siteId);
7272
})->flatten()->unique()->values()->toArray();
7373
} else {
7474
$criteriaSiteIds = Arr::wrap($scoutIndex->criteria->siteId);
7575
}
7676

7777

78-
$siteIds = array_map(function ($siteId) {
78+
$siteIds = array_map(function($siteId) {
7979
return (int)$siteId;
8080
}, $criteriaSiteIds);
8181

@@ -91,7 +91,7 @@ public function getIndices(): Collection
9191

9292
public function searchableUsing(): Collection
9393
{
94-
return $this->getIndices()->map(function (ScoutIndex $scoutIndex) {
94+
return $this->getIndices()->map(function(ScoutIndex $scoutIndex) {
9595
return Scout::$plugin->getSettings()->getEngine($scoutIndex);
9696
});
9797
}
@@ -102,7 +102,7 @@ public function searchable(bool $propagate = true)
102102
return;
103103
}
104104

105-
$this->searchableUsing()->each(function (Engine $engine) use ($propagate) {
105+
$this->searchableUsing()->each(function(Engine $engine) use ($propagate) {
106106
if (!$this->validatesCriteria($engine->scoutIndex)) {
107107
return $engine->delete($this->owner);
108108
}
@@ -151,7 +151,7 @@ public function searchableRelations(): void
151151
return;
152152
}
153153

154-
$this->getRelatedElements()->each(function (Element $relatedElement) {
154+
$this->getRelatedElements()->each(function(Element $relatedElement) {
155155
/* @var SearchableBehavior $relatedElement */
156156
$relatedElement->searchable(false);
157157
});
@@ -167,7 +167,7 @@ public function getRelatedElements(): Collection
167167

168168
if (!empty($settings->relatedElementTypes)) {
169169
return Collection::make($settings->relatedElementTypes)
170-
->flatMap(function ($className) {
170+
->flatMap(function($className) {
171171
return $className::find()->relatedTo($this->owner)->site('*')->all();
172172
});
173173
}

0 commit comments

Comments
 (0)