@@ -150,8 +150,7 @@ discard block |
||
| 150 | 150 | throw new ModelNotDefinedInAggregatorException(); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - return method_exists($this->model, 'toSearchableArray') ? $this->model->toSearchableArray() : |
|
| 154 | - $this->model->toArray(); |
|
| 153 | + return method_exists($this->model, 'toSearchableArray') ? $this->model->toSearchableArray() : $this->model->toArray(); |
|
| 155 | 154 | } |
| 156 | 155 | |
| 157 | 156 | /** |
@@ -167,10 +166,10 @@ discard block |
||
| 167 | 166 | $softDeletes = |
| 168 | 167 | in_array(SoftDeletes::class, class_uses_recursive($model)) && config('scout.soft_delete', false); |
| 169 | 168 | |
| 170 | - $instance->newQuery()->when($softDeletes, function ($query) { |
|
| 169 | + $instance->newQuery()->when($softDeletes, function($query) { |
|
| 171 | 170 | $query->withTrashed(); |
| 172 | - })->orderBy($instance->getKeyName())->chunk(config('scout.chunk.searchable', 500), function ($models) { |
|
| 173 | - $models = $models->map(function ($model) { |
|
| 171 | + })->orderBy($instance->getKeyName())->chunk(config('scout.chunk.searchable', 500), function($models) { |
|
| 172 | + $models = $models->map(function($model) { |
|
| 174 | 173 | return static::create($model); |
| 175 | 174 | })->filter->shouldBeSearchable(); |
| 176 | 175 | |
@@ -192,7 +191,7 @@ discard block |
||
| 192 | 191 | $softDeletes = |
| 193 | 192 | in_array(SoftDeletes::class, class_uses_recursive($model), true) && config('scout.soft_delete', false); |
| 194 | 193 | |
| 195 | - $count += $model::query()->when($softDeletes, function ($query) { |
|
| 194 | + $count += $model::query()->when($softDeletes, function($query) { |
|
| 196 | 195 | $query->withTrashed(); |
| 197 | 196 | })->count(); |
| 198 | 197 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | foreach ($searchableFinder->fromCommand($this) as $searchable) { |
| 42 | 42 | $this->call('scout:flush', ['searchable' => $searchable]); |
| 43 | 43 | |
| 44 | - $events->listen(ModelsImported::class, function ($event) use ($searchable) { |
|
| 44 | + $events->listen(ModelsImported::class, function($event) use ($searchable) { |
|
| 45 | 45 | $last = ObjectIdEncrypter::encrypt($event->models->last()); |
| 46 | 46 | |
| 47 | 47 | $this->line('<comment>Imported ['.$searchable.'] models up to ID:</comment> '.$last); |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | |
| 111 | 111 | $wheres = $this->mutateWheres($builder->wheres); |
| 112 | 112 | |
| 113 | - return collect($wheres)->map(function ($value, $key) use ($operators) { |
|
| 113 | + return collect($wheres)->map(function($value, $key) use ($operators) { |
|
| 114 | 114 | if (ends_with($key, $operators) || starts_with($value, $operators)) { |
| 115 | 115 | return $key.' '.$value; |
| 116 | 116 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | { |
| 44 | 44 | $callback = $this->callback; |
| 45 | 45 | |
| 46 | - $this->callback = function ($algolia, $query, $baseParameters) use ($parameters, $callback) { |
|
| 46 | + $this->callback = function($algolia, $query, $baseParameters) use ($parameters, $callback) { |
|
| 47 | 47 | $parameters = array_merge($parameters, $baseParameters); |
| 48 | 48 | |
| 49 | 49 | if (is_callable($callback)) { |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | continue; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - if (! $this->hasToSearchableArray($searchable)) { |
|
| 109 | + if ( ! $this->hasToSearchableArray($searchable)) { |
|
| 110 | 110 | $array = $this->sanitize($searchable, $array); |
| 111 | 111 | } |
| 112 | 112 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | { |
| 146 | 146 | $class = get_class($searchable->getModel()); |
| 147 | 147 | |
| 148 | - if (! array_key_exists($class, $this->splittables)) { |
|
| 148 | + if ( ! array_key_exists($class, $this->splittables)) { |
|
| 149 | 149 | $this->splittables[$class] = false; |
| 150 | 150 | |
| 151 | 151 | foreach ($searchable->toSearchableArray() as $key => $value) { |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $objects = $temp; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - return array_map(function ($object) use ($array) { |
|
| 205 | + return array_map(function($object) use ($array) { |
|
| 206 | 206 | return array_merge($array, $object); |
| 207 | 207 | }, $objects); |
| 208 | 208 | } |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | { |
| 229 | 229 | $searchableClass = get_class($searchable); |
| 230 | 230 | |
| 231 | - if (! array_key_exists($searchableClass, $this->searchablesWithToSearchableArray)) { |
|
| 231 | + if ( ! array_key_exists($searchableClass, $this->searchablesWithToSearchableArray)) { |
|
| 232 | 232 | $file = (new ReflectionClass(get_class($searchable)))->getMethod('toSearchableArray')->getFileName(); |
| 233 | 233 | |
| 234 | 234 | $this->searchablesWithToSearchableArray[$searchableClass] = |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | foreach ($searchableFinder->fromCommand($this) as $searchable) { |
| 47 | 47 | $this->output->text(' |