Completed
Pull Request — master (#128)
by
unknown
01:37
created
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.