Completed
Push — master ( ce1f91...395dff )
by Nenad
01:38 queued 11s
created
src/TNTSearchScoutServiceProvider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      */
16 16
     public function boot()
17 17
     {
18
-        $this->app[EngineManager::class]->extend('tntsearch', function ($app) {
18
+        $this->app[EngineManager::class]->extend('tntsearch', function($app) {
19 19
             $tnt = new TNTSearch();
20 20
             
21 21
             $driver = config('database.default');
Please login to merge, or discard this 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 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   +8 added lines, -8 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 $model->newCollection($results['ids'])->map(function ($hit) use ($models) {
202
+        return $model->newCollection($results['ids'])->map(function($hit) use ($models) {
203 203
             if (isset($models[$hit])) {
204 204
                 return $models[$hit];
205 205
             }
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 
289 289
         $discardIds = $builder->model->newQuery()
290 290
             ->select($qualifiedKeyName)
291
-            ->leftJoin(DB::raw('('.$sub->getQuery()->toSql().') as '. $builder->model->getConnection()->getTablePrefix() .'sub'), $subQualifiedKeyName, '=', $qualifiedKeyName)
291
+            ->leftJoin(DB::raw('('.$sub->getQuery()->toSql().') as '.$builder->model->getConnection()->getTablePrefix().'sub'), $subQualifiedKeyName, '=', $qualifiedKeyName)
292 292
             ->addBinding($sub->getQuery()->getBindings(), 'join')
293 293
             ->whereIn($qualifiedKeyName, $searchResults)
294 294
             ->whereNull($subQualifiedKeyName)
@@ -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.
src/Console/StatusCommand.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
129 129
     }
130 130
 
131 131
     /**
132
-     * @param $trait
132
+     * @param string $trait
133 133
      * @return \Closure
134 134
      */
135 135
     private function isSearchableModel($trait)
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -5,9 +5,7 @@
 block discarded – undo
5 5
 use Illuminate\Console\Command;
6 6
 use Illuminate\Contracts\Events\Dispatcher;
7 7
 use TeamTNT\TNTSearch\Exceptions\IndexNotFoundException;
8
-use TeamTNT\TNTSearch\Indexer\TNTIndexer;
9 8
 use TeamTNT\TNTSearch\TNTSearch;
10
-use Illuminate\Support\Facades\Schema;
11 9
 use Symfony\Component\Finder\Finder;
12 10
 
13 11
 class StatusCommand extends Command
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             $rowsTotal = $model->count();
69 69
             $recordsDifference = $rowsTotal - $rowsIndexed;
70 70
 
71
-            if($recordsDifference == 0) {
71
+            if ($recordsDifference == 0) {
72 72
                 $recordsDifference = '<fg=green>Synchronized</>';
73 73
             } else {
74 74
                 $recordsDifference = "<fg=red>$recordsDifference</>";
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
      */
121 121
     private function getSearchableModels()
122 122
     {
123
-        $searchableModels = (array)$this->argument('model');
123
+        $searchableModels = (array) $this->argument('model');
124 124
         if (empty($searchableModels)) {
125 125
             $searchableModels = $this->getSearchableModelsFromClasses();
126 126
         }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      */
135 135
     private function isSearchableModel($trait)
136 136
     {
137
-        return function ($className) use ($trait) {
137
+        return function($className) use ($trait) {
138 138
             $traits = class_uses($className);
139 139
 
140 140
             return isset($traits[$trait]);
Please login to merge, or discard this patch.