Completed
Pull Request — master (#259)
by
unknown
01:22
created
src/Engines/TNTSearchEngine.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         }
64 64
 
65 65
         $index->indexBeginTransaction();
66
-        $models->each(function ($model) use ($index, $geoindex) {
66
+        $models->each(function($model) use ($index, $geoindex) {
67 67
             $array = $model->toSearchableArray();
68 68
 
69 69
             if (empty($array)) {
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     public function delete($models)
101 101
     {
102 102
         $this->initIndex($models->first());
103
-        $models->each(function ($model) {
103
+        $models->each(function($model) {
104 104
             $this->tnt->selectIndex("{$model->searchableAs()}.index");
105 105
             $index = $this->tnt->getIndex();
106 106
             $index->setPrimaryKey($model->getKeyName());
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
         }
245 245
 
246 246
         // sort models by tnt search result set
247
-        return collect($results['ids'])->map(function ($hit) use ($models) {
247
+        return collect($results['ids'])->map(function($hit) use ($models) {
248 248
             if (isset($models[$hit])) {
249 249
                 return $models[$hit];
250 250
             }
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 
339 339
         $discardIds = $builder->model->newQuery()
340 340
             ->select($qualifiedKeyName)
341
-            ->leftJoin(DB::raw('('.$sub->getQuery()->toSql().') as '. $builder->model->getConnection()->getTablePrefix() .'sub'), $subQualifiedKeyName, '=', $qualifiedKeyName)
341
+            ->leftJoin(DB::raw('('.$sub->getQuery()->toSql().') as '.$builder->model->getConnection()->getTablePrefix().'sub'), $subQualifiedKeyName, '=', $qualifiedKeyName)
342 342
             ->addBinding($sub->getQuery()->getBindings(), 'join')
343 343
             ->whereIn($qualifiedKeyName, $searchResults)
344 344
             ->whereNull($subQualifiedKeyName)
@@ -409,10 +409,10 @@  discard block
 block discarded – undo
409 409
     private function applyWheres($builder)
410 410
     {
411 411
         // iterate over given where clauses
412
-        return collect($this->builder->wheres)->map(function ($value, $key) {
412
+        return collect($this->builder->wheres)->map(function($value, $key) {
413 413
             // for reduce function combine key and value into array
414 414
             return [$key, $value];
415
-        })->reduce(function ($builder, $where) {
415
+        })->reduce(function($builder, $where) {
416 416
             // separate key, value again
417 417
             list($key, $value) = $where;
418 418
             return $builder->where($key, $value);
@@ -428,10 +428,10 @@  discard block
 block discarded – undo
428 428
     private function applyOrders($builder)
429 429
     {
430 430
         //iterate over given orderBy clauses - should be only one
431
-        return collect($this->builder->orders)->map(function ($value, $key) {
431
+        return collect($this->builder->orders)->map(function($value, $key) {
432 432
             // for reduce function combine key and value into array
433 433
             return [$value["column"], $value["direction"]];
434
-        })->reduce(function ($builder, $orderBy) {
434
+        })->reduce(function($builder, $orderBy) {
435 435
             // separate key, value again
436 436
             list($column, $direction) = $orderBy;
437 437
             return $builder->orderBy($column, $direction);
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
             unlink($pathToIndex);
453 453
         }
454 454
 
455
-        if ($this->geotnt){
455
+        if ($this->geotnt) {
456 456
             $pathToGeoIndex = $this->geotnt->config['storage']."/{$indexName}.geoindex";
457 457
             if (file_exists($pathToGeoIndex)) {
458 458
                 unlink($pathToGeoIndex);
Please login to merge, or discard this patch.