Completed
Push — master ( 395dff...154971 )
by Nenad
08:08
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   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         $index->setPrimaryKey($models->first()->getKeyName());
49 49
 
50 50
         $index->indexBeginTransaction();
51
-        $models->each(function ($model) use ($index) {
51
+        $models->each(function($model) use ($index) {
52 52
             $array = $model->toSearchableArray();
53 53
 
54 54
             if (empty($array)) {
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     public function delete($models)
75 75
     {
76 76
         $this->initIndex($models->first());
77
-        $models->each(function ($model) {
77
+        $models->each(function($model) {
78 78
             $this->tnt->selectIndex("{$model->searchableAs()}.index");
79 79
             $index = $this->tnt->getIndex();
80 80
             $index->setPrimaryKey($model->getKeyName());
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         }
206 206
 
207 207
         // sort models by tnt search result set
208
-        return $model->newCollection($results['ids'])->map(function ($hit) use ($models) {
208
+        return $model->newCollection($results['ids'])->map(function($hit) use ($models) {
209 209
             if (isset($models[$hit])) {
210 210
                 return $models[$hit];
211 211
             }
@@ -365,10 +365,10 @@  discard block
 block discarded – undo
365 365
     private function applyWheres($builder)
366 366
     {
367 367
         // iterate over given where clauses
368
-        return collect($this->builder->wheres)->map(function ($value, $key) {
368
+        return collect($this->builder->wheres)->map(function($value, $key) {
369 369
             // for reduce function combine key and value into array
370 370
             return [$key, $value];
371
-        })->reduce(function ($builder, $where) {
371
+        })->reduce(function($builder, $where) {
372 372
             // separate key, value again
373 373
             list($key, $value) = $where;
374 374
             return $builder->where($key, $value);
@@ -384,10 +384,10 @@  discard block
 block discarded – undo
384 384
     private function applyOrders($builder)
385 385
     {
386 386
         //iterate over given orderBy clauses - should be only one
387
-        return collect($this->builder->orders)->map(function ($value, $key) {
387
+        return collect($this->builder->orders)->map(function($value, $key) {
388 388
             // for reduce function combine key and value into array
389 389
             return [$value["column"], $value["direction"]];
390
-        })->reduce(function ($builder, $orderBy) {
390
+        })->reduce(function($builder, $orderBy) {
391 391
             // separate key, value again
392 392
             list($column, $direction) = $orderBy;
393 393
             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.
src/Events/SearchPerformed.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -4,6 +4,9 @@
 block discarded – undo
4 4
 
5 5
 class SearchPerformed
6 6
 {
7
+    /**
8
+     * @param \Laravel\Scout\Builder $builder
9
+     */
7 10
     public function __construct($builder, $results, $isBooleanSearch = false)
8 11
     {
9 12
         $this->query           = $builder->query;
Please login to merge, or discard this patch.