Completed
Push — master ( c82479...368424 )
by Nenad
23s queued 12s
created
src/Engines/TNTSearchEngine.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         $index->setPrimaryKey($models->first()->getKeyName());
59 59
 
60 60
         $index->indexBeginTransaction();
61
-        $models->each(function ($model) use ($index) {
61
+        $models->each(function($model) use ($index) {
62 62
             $array = $model->toSearchableArray();
63 63
 
64 64
             if (empty($array)) {
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     public function delete($models)
85 85
     {
86 86
         $this->initIndex($models->first());
87
-        $models->each(function ($model) {
87
+        $models->each(function($model) {
88 88
             $this->tnt->selectIndex("{$model->searchableAs()}.index");
89 89
             $index = $this->tnt->getIndex();
90 90
             $index->setPrimaryKey($model->getKeyName());
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         }
219 219
 
220 220
         // sort models by tnt search result set
221
-        return $model->newCollection(collect($results['ids'])->map(function ($hit) use ($models, $results) {
221
+        return $model->newCollection(collect($results['ids'])->map(function($hit) use ($models, $results) {
222 222
             if (isset($models[$hit])) {
223 223
                 return $models[$hit]->setAttribute('__tntSearchScore__', $results['docScores'][$hit]);
224 224
             }
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
         }
258 258
 
259 259
         // sort models by tnt search result set
260
-        return $model->newCollection($results['ids'])->map(function ($hit) use ($models) {
260
+        return $model->newCollection($results['ids'])->map(function($hit) use ($models) {
261 261
             if (isset($models[$hit])) {
262 262
                 return $models[$hit];
263 263
             }
@@ -421,10 +421,10 @@  discard block
 block discarded – undo
421 421
     private function applyWheres($builder)
422 422
     {
423 423
         // iterate over given where clauses
424
-        return collect($this->builder->wheres)->map(function ($value, $key) {
424
+        return collect($this->builder->wheres)->map(function($value, $key) {
425 425
             // for reduce function combine key and value into array
426 426
             return [$key, $value];
427
-        })->reduce(function ($builder, $where) {
427
+        })->reduce(function($builder, $where) {
428 428
             // separate key, value again
429 429
             list($key, $value) = $where;
430 430
             return $builder->where($key, $value);
@@ -440,10 +440,10 @@  discard block
 block discarded – undo
440 440
     private function applyOrders($builder)
441 441
     {
442 442
         //iterate over given orderBy clauses - should be only one
443
-        return collect($this->builder->orders)->map(function ($value, $key) {
443
+        return collect($this->builder->orders)->map(function($value, $key) {
444 444
             // for reduce function combine key and value into array
445 445
             return [$value["column"], $value["direction"]];
446
-        })->reduce(function ($builder, $orderBy) {
446
+        })->reduce(function($builder, $orderBy) {
447 447
             // separate key, value again
448 448
             list($column, $direction) = $orderBy;
449 449
             return $builder->orderBy($column, $direction);
Please login to merge, or discard this patch.