Skip to content

Commit 6c5cb8f

Browse files
committed
Fix CS.
1 parent 77c2891 commit 6c5cb8f

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

src/PostgresEngine.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __construct(ConnectionResolverInterface $resolver, $config)
5353
*/
5454
public function update($models)
5555
{
56-
if (!$this->shouldMaintainIndex($models->first())) {
56+
if (! $this->shouldMaintainIndex($models->first())) {
5757
return;
5858
}
5959

@@ -86,7 +86,7 @@ protected function performUpdate(Model $model)
8686

8787
return $query->insert(
8888
$data->merge([
89-
$model->getKeyName() => $model->getKey()
89+
$model->getKeyName() => $model->getKey(),
9090
])->all()
9191
);
9292
}
@@ -107,6 +107,7 @@ protected function toVector(Model $model)
107107
if ($label = $this->rankFieldWeightLabel($model, $key)) {
108108
return "setweight(to_tsvector(?), '$label')";
109109
}
110+
110111
return 'to_tsvector(?)';
111112
})->implode(' || ');
112113

@@ -214,7 +215,7 @@ public function map($results, $model)
214215
{
215216
if (empty($results)) {
216217
return Collection::make();
217-
};
218+
}
218219

219220
$results = collect($results);
220221

@@ -255,7 +256,7 @@ protected function connect()
255256
/**
256257
* Build ranking expression that will be used in a search.
257258
* ts_rank([ weights, ] vector, query [, normalization ])
258-
* ts_rank_cd([ weights, ] vector, query [, normalization ])
259+
* ts_rank_cd([ weights, ] vector, query [, normalization ]).
259260
*
260261
* @param \Illuminate\Database\Eloquent\Model $model
261262
* @param string $indexColumn
@@ -343,7 +344,7 @@ protected function rankNormalization(Model $model)
343344
*/
344345
protected function shouldMaintainIndex(Model $model = null)
345346
{
346-
if ((bool)$this->config('maintain_index', true) === false) {
347+
if ((bool) $this->config('maintain_index', true) === false) {
347348
return false;
348349
}
349350

src/PostgresEngineServiceProvider.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace ScoutEngines\Postgres;
44

5-
use Illuminate\Database\ConnectionResolver;
6-
use Illuminate\Database\ConnectionResolverInterface;
75
use Illuminate\Support\ServiceProvider;
86
use Laravel\Scout\EngineManager;
97

tests/PostgresEngineTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ public function test_map_correctly_maps_results_to_models()
119119
$model->shouldReceive('get')->once()->andReturn(Collection::make([new TestModel()]));
120120

121121
$results = $engine->map(
122-
json_decode('[{"id": 1, "rank": 0.33}]')
123-
, $model);
122+
json_decode('[{"id": 1, "rank": 0.33}]'), $model);
124123

125124
$this->assertCount(1, $results);
126125
}
@@ -181,4 +180,4 @@ public function searchableAdditionalArray()
181180
{
182181
return $this->searchableAdditionalArray;
183182
}
184-
}
183+
}

0 commit comments

Comments
 (0)