Completed
Push — master ( 09b9c9...ea9622 )
by Nenad
17s 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/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
 
69 69
             $indexedColumns = $rowsTotal ? implode(",", array_keys($model->first()->toSearchableArray())) : '';
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</>";
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      */
127 127
     private function getSearchableModels()
128 128
     {
129
-        $searchableModels = (array)$this->argument('model');
129
+        $searchableModels = (array) $this->argument('model');
130 130
         if (empty($searchableModels)) {
131 131
             $searchableModels = $this->getSearchableModelsFromClasses();
132 132
         }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
      */
141 141
     private function isSearchableModel($trait)
142 142
     {
143
-        return function ($className) use ($trait) {
143
+        return function($className) use ($trait) {
144 144
             $traits = class_uses($className);
145 145
 
146 146
             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.
src/Console/ImportCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
         $tnt->loadConfig($config);
44 44
         $tnt->setDatabaseHandle($db->getPdo());
45 45
 
46
-        if(!$model->count()) {
46
+        if (!$model->count()) {
47 47
             $this->info('Nothing to import.');
48 48
             exit(0);
49 49
         }
Please login to merge, or discard this patch.
src/Engines/TNTSearchEngine.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -287,6 +287,7 @@  discard block
 block discarded – undo
287 287
      * The constraints usually remove only a small amount of results, which is why the non
288 288
      * matching results are looked up and removed, instead of returning a collection with
289 289
      * all the valid results.
290
+     * @param Builder $builder
290 291
      */
291 292
     private function discardIdsFromResultSetByConstraints($builder, $searchResults)
292 293
     {
@@ -445,6 +446,9 @@  discard block
 block discarded – undo
445 446
      *
446 447
      * @param  string
447 448
      * @param  string
449
+     * @param string $name
450
+     * @param string $result
451
+     * @param string $model
448 452
      * @return string
449 453
      */
450 454
     public function applyFilters($name, $result, $model)
Please login to merge, or discard this 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($results['ids'])->map(function ($hit) use ($models) {
221
+        return $model->newCollection($results['ids'])->map(function($hit) use ($models) {
222 222
             if (isset($models[$hit])) {
223 223
                 return $models[$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.