Completed
Pull Request — master (#128)
by
unknown
01:37
created
src/TNTSearchScoutServiceProvider.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -37,6 +37,9 @@  discard block
 block discarded – undo
37 37
         }
38 38
     }
39 39
 
40
+    /**
41
+     * @param TNTSearch $tnt
42
+     */
40 43
     protected function setFuzziness($tnt)
41 44
     {
42 45
         $tnt->fuzziness            = config('scout.tntsearch.fuzziness', $tnt->fuzziness);
@@ -45,6 +48,9 @@  discard block
 block discarded – undo
45 48
         $tnt->fuzzy_max_expansions = config('scout.tntsearch.fuzzy.max_expansions', $tnt->fuzzy_max_expansions);
46 49
     }
47 50
 
51
+    /**
52
+     * @param TNTSearch $tnt
53
+     */
48 54
     protected function setAsYouType($tnt)
49 55
     {
50 56
         $tnt->asYouType = config('scout.tntsearch.asYouType', $tnt->asYouType);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      */
16 16
     public function boot()
17 17
     {
18
-        $this->app[EngineManager::class]->extend('tntsearch', function ($app) {
18
+        $this->app[EngineManager::class]->extend('tntsearch', function($app) {
19 19
             $tnt = new TNTSearch();
20 20
             
21 21
             $driver = config('database.default');
Please login to merge, or discard this patch.
src/Engines/TNTSearchEngine.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         $index->setPrimaryKey($models->first()->getKeyName());
50 50
 
51 51
         $index->indexBeginTransaction();
52
-        $models->each(function ($model) use ($index) {
52
+        $models->each(function($model) use ($index) {
53 53
             $array = $model->toSearchableArray();
54 54
 
55 55
             if (empty($array)) {
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     public function delete($models)
76 76
     {
77 77
         $this->initIndex($models->first());
78
-        $models->each(function ($model) {
78
+        $models->each(function($model) {
79 79
             $this->tnt->selectIndex("{$model->searchableAs()}.index");
80 80
             $index = $this->tnt->getIndex();
81 81
             $index->setPrimaryKey($model->getKeyName());
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
      */
170 170
     protected function filters(Builder $builder)
171 171
     {
172
-        return collect($builder->wheres)->map(function ($value, $key) {
172
+        return collect($builder->wheres)->map(function($value, $key) {
173 173
             return $key.'='.$value;
174 174
         })->values()->all();
175 175
     }
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
     protected function modelCollection($results)
233 233
     {
234
-        if (! is_null($this->modelCollection)) {
234
+        if (!is_null($this->modelCollection)) {
235 235
             return $this->modelCollection;
236 236
         }
237 237
 
@@ -241,10 +241,10 @@  discard block
 block discarded – undo
241 241
             $this->builder->model->getQualifiedKeyName(), $keys
242 242
         )->get()->keyBy($this->builder->model->getKeyName());
243 243
 
244
-        $this->modelCollection = collect($results['ids'])->map(function ($hit) use ($models) {
244
+        $this->modelCollection = collect($results['ids'])->map(function($hit) use ($models) {
245 245
             return $models->has($hit) ? $models[$hit] : null;
246
-        })->filter(function ($model) use ($fieldsWheres) {
247
-            return !is_null($model) && array_reduce($fieldsWheres, function ($carry, $item) use($model) {
246
+        })->filter(function($model) use ($fieldsWheres) {
247
+            return !is_null($model) && array_reduce($fieldsWheres, function($carry, $item) use($model) {
248 248
                     return $carry && $model[$item] == $this->builder->wheres[$item];
249 249
                 }, true);
250 250
         });
Please login to merge, or discard this patch.