Completed
Pull Request — master (#38)
by
unknown
08:30
created
src/TNTSearchScoutServiceProvider.php 2 patches
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 register()
17 17
     {
18
-        $this->app[EngineManager::class]->extend('tntsearch', function () {
18
+        $this->app[EngineManager::class]->extend('tntsearch', function() {
19 19
             $tnt = new TNTSearch();
20 20
             $tnt->loadConfig(config('scout.tntsearch'));
21 21
 
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -36,6 +36,9 @@
 block discarded – undo
36 36
         }
37 37
     }
38 38
 
39
+    /**
40
+     * @param TNTSearch $tnt
41
+     */
39 42
     private function setFuzziness($tnt)
40 43
     {
41 44
         $prefix_length = config('scout.tntsearch.fuzzy.prefix_length');
Please login to merge, or discard this patch.
src/Engines/TNTSearchEngine.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -154,13 +154,13 @@
 block discarded – undo
154 154
             $model->getKeyName(), $keys
155 155
         )->get()->keyBy($model->getKeyName());
156 156
 
157
-	    return collect($results['ids'])->map(function ($hit) use ($models) {
158
-		    if ($models->has($hit)) {
159
-			    return $models[$hit];
160
-		    }
161
-	    })->filter(function ($value) {
162
-		    return (!is_null($value));
163
-	    });
157
+        return collect($results['ids'])->map(function ($hit) use ($models) {
158
+            if ($models->has($hit)) {
159
+                return $models[$hit];
160
+            }
161
+        })->filter(function ($value) {
162
+            return (!is_null($value));
163
+        });
164 164
     }
165 165
 
166 166
     /**
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     public function update($models)
35 35
     {
36 36
         $this->initIndex($models->first());
37
-        $models->each(function ($model) {
37
+        $models->each(function($model) {
38 38
             $searchableFields = $model->toSearchableArray();
39 39
 
40 40
             $this->tnt->selectIndex("{$model->searchableAs()}.index");
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     public function delete($models)
60 60
     {
61 61
         $this->initIndex($models->first());
62
-        $models->each(function ($model) {
62
+        $models->each(function($model) {
63 63
             $this->tnt->selectIndex("{$model->searchableAs()}.index");
64 64
             $index = $this->tnt->getIndex();
65 65
             $index->setPrimaryKey($model->getKeyName());
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      */
131 131
     protected function filters(Builder $builder)
132 132
     {
133
-        return collect($builder->wheres)->map(function ($value, $key) {
133
+        return collect($builder->wheres)->map(function($value, $key) {
134 134
             return $key.'='.$value;
135 135
         })->values()->all();
136 136
     }
@@ -154,11 +154,11 @@  discard block
 block discarded – undo
154 154
             $model->getKeyName(), $keys
155 155
         )->get()->keyBy($model->getKeyName());
156 156
 
157
-	    return collect($results['ids'])->map(function ($hit) use ($models) {
157
+	    return collect($results['ids'])->map(function($hit) use ($models) {
158 158
 		    if ($models->has($hit)) {
159 159
 			    return $models[$hit];
160 160
 		    }
161
-	    })->filter(function ($value) {
161
+	    })->filter(function($value) {
162 162
 		    return (!is_null($value));
163 163
 	    });
164 164
     }
Please login to merge, or discard this patch.