Completed
Push — master ( e296a7...01e065 )
by Nenad
13:49
created
src/Engines/TNTSearchEngine.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -291,6 +291,7 @@
 block discarded – undo
291 291
      * The constraints usually remove only a small amount of results, which is why the non
292 292
      * matching results are looked up and removed, instead of returning a collection with
293 293
      * all the valid results.
294
+     * @param Builder $builder
294 295
      */
295 296
     private function discardIdsFromResultSetByConstraints($builder, $searchResults)
296 297
     {
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $index->setPrimaryKey($models->first()->getKeyName());
48 48
 
49 49
         $index->indexBeginTransaction();
50
-        $models->each(function ($model) use ($index) {
50
+        $models->each(function($model) use ($index) {
51 51
             $array = $model->toSearchableArray();
52 52
 
53 53
             if (empty($array)) {
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     public function delete($models)
74 74
     {
75 75
         $this->initIndex($models->first());
76
-        $models->each(function ($model) {
76
+        $models->each(function($model) {
77 77
             $this->tnt->selectIndex("{$model->searchableAs()}.index");
78 78
             $index = $this->tnt->getIndex();
79 79
             $index->setPrimaryKey($model->getKeyName());
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         }
200 200
 
201 201
         // sort models by tnt search result set
202
-        return collect($results['ids'])->map(function ($hit) use ($models) {
202
+        return collect($results['ids'])->map(function($hit) use ($models) {
203 203
             if (isset($models[$hit])) {
204 204
                 return $models[$hit];
205 205
             }
@@ -359,10 +359,10 @@  discard block
 block discarded – undo
359 359
     private function applyWheres($builder)
360 360
     {
361 361
         // iterate over given where clauses
362
-        return collect($this->builder->wheres)->map(function ($value, $key) {
362
+        return collect($this->builder->wheres)->map(function($value, $key) {
363 363
             // for reduce function combine key and value into array
364 364
             return [$key, $value];
365
-        })->reduce(function ($builder, $where) {
365
+        })->reduce(function($builder, $where) {
366 366
             // separate key, value again
367 367
             list($key, $value) = $where;
368 368
             return $builder->where($key, $value);
@@ -378,10 +378,10 @@  discard block
 block discarded – undo
378 378
     private function applyOrders($builder)
379 379
     {
380 380
         //iterate over given orderBy clauses - should be only one
381
-        return collect($this->builder->orders)->map(function ($value, $key) {
381
+        return collect($this->builder->orders)->map(function($value, $key) {
382 382
             // for reduce function combine key and value into array
383 383
             return [$value["column"], $value["direction"]];
384
-        })->reduce(function ($builder, $orderBy) {
384
+        })->reduce(function($builder, $orderBy) {
385 385
             // separate key, value again
386 386
             list($column, $direction) = $orderBy;
387 387
             return $builder->orderBy($column, $direction);
Please login to merge, or discard this patch.