@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | $updateQuery = $this->client->createUpdate(); |
66 | 66 | |
67 | - $ids = $models->map(function ($model) { |
|
67 | + $ids = $models->map(function($model) { |
|
68 | 68 | return $model->getScoutKey(); |
69 | 69 | }); |
70 | 70 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function paginate(Builder $builder, $perPage, $page) |
97 | 97 | { |
98 | - return $this->performSearch($builder, $perPage,$page - 1); |
|
98 | + return $this->performSearch($builder, $perPage, $page - 1); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function mapIds($results) |
108 | 108 | { |
109 | - $ids = array_map(function ($document) { |
|
109 | + $ids = array_map(function($document) { |
|
110 | 110 | return $document->id; |
111 | 111 | }, $results->getDocuments()); |
112 | 112 | |
@@ -129,13 +129,13 @@ discard block |
||
129 | 129 | |
130 | 130 | $models = $model->getScoutModelsByIds( |
131 | 131 | $builder, collect($results->getDocuments())->pluck('id')->values()->all() |
132 | - )->keyBy(function ($model) { |
|
132 | + )->keyBy(function($model) { |
|
133 | 133 | return $model->getScoutKey(); |
134 | 134 | }); |
135 | 135 | |
136 | - return Collection::make($results->getDocuments())->map(function ($document) use ($models) { |
|
137 | - if (isset($models[$document['id']])) { |
|
138 | - return $models[$document['id']]; |
|
136 | + return Collection::make($results->getDocuments())->map(function($document) use ($models) { |
|
137 | + if (isset($models[ $document[ 'id' ] ])) { |
|
138 | + return $models[ $document[ 'id' ] ]; |
|
139 | 139 | } |
140 | 140 | })->filter()->values(); |
141 | 141 | } |
@@ -163,12 +163,12 @@ discard block |
||
163 | 163 | { |
164 | 164 | $selectQuery = $this->client->createSelect(); |
165 | 165 | |
166 | - $conditions = (empty($builder->query)) ? [] : [$builder->query]; |
|
166 | + $conditions = (empty($builder->query)) ? [ ] : [ $builder->query ]; |
|
167 | 167 | $conditions = array_merge($conditions, $this->filters($builder)); |
168 | 168 | |
169 | 169 | $selectQuery->setQuery(implode(' ', $conditions)); |
170 | 170 | |
171 | - if(!is_null($perPage)) { |
|
171 | + if (!is_null($perPage)) { |
|
172 | 172 | $selectQuery->setStart($offset)->setRows($perPage); |
173 | 173 | } |
174 | 174 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | */ |
186 | 186 | protected function filters(Builder $builder) |
187 | 187 | { |
188 | - return collect($builder->wheres)->map(function ($value, $key) { |
|
188 | + return collect($builder->wheres)->map(function($value, $key) { |
|
189 | 189 | return sprintf('%s:"%s"', $key, $value); |
190 | 190 | })->values()->all(); |
191 | 191 | } |