Completed
Push — master ( 9df611...a3ae3d )
by Nenad
11s
created
src/TNTSearchScoutServiceProvider.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -43,6 +43,9 @@  discard block
 block discarded – undo
43 43
         });
44 44
     }
45 45
 
46
+    /**
47
+     * @param TNTSearch $tnt
48
+     */
46 49
     protected function setFuzziness($tnt)
47 50
     {
48 51
         $tnt->fuzziness            = config('scout.tntsearch.fuzziness', $tnt->fuzziness);
@@ -51,6 +54,9 @@  discard block
 block discarded – undo
51 54
         $tnt->fuzzy_max_expansions = config('scout.tntsearch.fuzzy.max_expansions', $tnt->fuzzy_max_expansions);
52 55
     }
53 56
 
57
+    /**
58
+     * @param TNTSearch $tnt
59
+     */
54 60
     protected function setAsYouType($tnt)
55 61
     {
56 62
         $tnt->asYouType = config('scout.tntsearch.asYouType', $tnt->asYouType);
Please login to merge, or discard this patch.
src/Engines/TNTSearchEngine.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $index->setPrimaryKey($models->first()->getKeyName());
46 46
 
47 47
         $index->indexBeginTransaction();
48
-        $models->each(function ($model) use ($index) {
48
+        $models->each(function($model) use ($index) {
49 49
             $array = $model->toSearchableArray();
50 50
 
51 51
             if (empty($array)) {
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     public function delete($models)
72 72
     {
73 73
         $this->initIndex($models->first());
74
-        $models->each(function ($model) {
74
+        $models->each(function($model) {
75 75
             $this->tnt->selectIndex("{$model->searchableAs()}.index");
76 76
             $index = $this->tnt->getIndex();
77 77
             $index->setPrimaryKey($model->getKeyName());
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
 
115 115
         $searchResults = $results['ids'];
116 116
 
117
-        $qualifiedKeyName = $builder->model->getQualifiedKeyName();  // tableName.id
118
-        $subQualifiedKeyName = 'sub.' . $builder->model->getKeyName(); // sub.id
117
+        $qualifiedKeyName = $builder->model->getQualifiedKeyName(); // tableName.id
118
+        $subQualifiedKeyName = 'sub.'.$builder->model->getKeyName(); // sub.id
119 119
     
120 120
         $sub = $this->getBuilder($builder->model)->whereIn(
121 121
             $qualifiedKeyName, $searchResults
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
      */
204 204
     protected function filters(Builder $builder)
205 205
     {
206
-        return collect($builder->wheres)->map(function ($value, $key) {
206
+        return collect($builder->wheres)->map(function($value, $key) {
207 207
             return $key.'='.$value;
208 208
         })->values()->all();
209 209
     }
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
             $model->getQualifiedKeyName(), $keys
231 231
         )->get()->keyBy($model->getKeyName());
232 232
 
233
-        return collect($results['ids'])->map(function ($hit) use ($models) {
233
+        return collect($results['ids'])->map(function($hit) use ($models) {
234 234
             if (isset($models[$hit])) {
235 235
                 return $models[$hit];
236 236
             }
@@ -251,10 +251,10 @@  discard block
 block discarded – undo
251 251
         $builder = $this->builder->constraints ?? $model->newQuery();
252 252
 
253 253
         // iterate over given where clauses
254
-        return collect($this->builder->wheres)->map(function ($value, $key) {
254
+        return collect($this->builder->wheres)->map(function($value, $key) {
255 255
             // for reduce function combine key and value into array
256 256
             return [$key, $value];
257
-        })->reduce(function ($builder, $where) {
257
+        })->reduce(function($builder, $where) {
258 258
             // separate key, value again
259 259
             list($key, $value) = $where;
260 260
             return $builder->where($key, $value);
Please login to merge, or discard this patch.