Passed
Pull Request — master (#5)
by
unknown
03:43
created
src/SolrProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function boot()
15 15
     {
16
-        app(EngineManager::class)->extend('solr', function ($app) {
16
+        app(EngineManager::class)->extend('solr', function($app) {
17 17
             $config = [
18 18
                 'endpoint' => [
19 19
                     'default' => [
Please login to merge, or discard this patch.
src/SolrEngine.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -40,19 +40,19 @@  discard block
 block discarded – undo
40 40
 
41 41
         $query = $this->client->createUpdate();
42 42
 
43
-        $models->each(function ($model) use (&$query) {
44
-            $attrs = array_filter($model->toSearchableArray(), function ($value) {
43
+        $models->each(function($model) use (&$query) {
44
+            $attrs = array_filter($model->toSearchableArray(), function($value) {
45 45
                 return !\is_null($value);
46 46
             });
47 47
 
48 48
             // Make sure there is an ID in the array,
49 49
             // otherwise we will create duplicates all the time.
50 50
             if (!\array_key_exists('id', $attrs)) {
51
-                $attrs['id'] = $model->getScoutKey();
51
+                $attrs[ 'id' ] = $model->getScoutKey();
52 52
             }
53 53
 
54 54
             // Add model class to attributes for flushing.
55
-            $attrs['_class'] = \get_class($model);
55
+            $attrs[ '_class' ] = \get_class($model);
56 56
 
57 57
             $document = $query->createDocument($attrs);
58 58
             $query->addDocument($document);
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             return;
77 77
         }
78 78
 
79
-        $ids = $models->map(function ($model) {
79
+        $ids = $models->map(function($model) {
80 80
             return $model->getScoutKey();
81 81
         });
82 82
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function mapIds($results)
124 124
     {
125
-        $ids = array_map(function ($document) {
125
+        $ids = array_map(function($document) {
126 126
             return $document->id;
127 127
         }, $results->getDocuments());
128 128
 
@@ -145,13 +145,13 @@  discard block
 block discarded – undo
145 145
 
146 146
         $models = $model->getScoutModelsByIds(
147 147
             $builder, collect($results->getDocuments())->pluck('id')->values()->all()
148
-        )->keyBy(function ($model) {
148
+        )->keyBy(function($model) {
149 149
             return $model->getScoutKey();
150 150
         });
151 151
 
152
-        return Collection::make($results->getDocuments())->map(function ($document) use ($models) {
153
-            if (isset($models[$document['id']])) {
154
-                return $models[$document['id']];
152
+        return Collection::make($results->getDocuments())->map(function($document) use ($models) {
153
+            if (isset($models[ $document[ 'id' ] ])) {
154
+                return $models[ $document[ 'id' ] ];
155 155
             }
156 156
         })->filter()->values();
157 157
     }
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     {
197 197
         $selectQuery = $this->client->createSelect();
198 198
 
199
-        $conditions = (empty($builder->query)) ? [] : [$builder->query];
199
+        $conditions = (empty($builder->query)) ? [ ] : [ $builder->query ];
200 200
         $conditions = array_merge($conditions, $this->filters($builder));
201 201
 
202 202
         $selectQuery->setQuery(implode(' ', $conditions));
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
      */
219 219
     protected function filters(Builder $builder)
220 220
     {
221
-        return collect($builder->wheres)->map(function ($value, $key) {
221
+        return collect($builder->wheres)->map(function($value, $key) {
222 222
             return sprintf('%s:"%s"', $key, $value);
223 223
         })->values()->all();
224 224
     }
Please login to merge, or discard this patch.