Completed
Pull Request — feat/html-splitter (#178)
by Nuno
24:27 queued 20:28
created
src/Searchable/ObjectIdEncrypter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
     {
90 90
         $parts = explode(self::$separator, $objectId);
91 91
 
92
-        if (! is_array($parts) || count($parts) < 2) {
92
+        if ( ! is_array($parts) || count($parts) < 2) {
93 93
             throw new ShouldReimportSearchableException('ObjectID seems invalid. You may need to
94 94
                 re-import your data using the `scout-reimport` Artisan command.');
95 95
         }
Please login to merge, or discard this patch.
src/Builder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      */
103 103
     public function whereIn($field, array $values): self
104 104
     {
105
-        $wheres = array_map(function ($value) use ($field) {
105
+        $wheres = array_map(function($value) use ($field) {
106 106
             return "$field={$this->transform($value)}";
107 107
         }, array_values($values));
108 108
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     {
125 125
         $callback = $this->callback;
126 126
 
127
-        $this->callback = function ($algolia, $query, $baseParameters) use ($parameters, $callback) {
127
+        $this->callback = function($algolia, $query, $baseParameters) use ($parameters, $callback) {
128 128
             $parameters = array_merge($parameters, $baseParameters);
129 129
 
130 130
             if (is_callable($callback)) {
Please login to merge, or discard this patch.
src/Engines/AlgoliaEngine.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -109,8 +109,8 @@
 block discarded – undo
109 109
     {
110 110
         $operators = ['<', '<=', '=', '!=', '>=', '>', ':'];
111 111
 
112
-        return collect($builder->wheres)->map(function ($value, $key) use ($operators) {
113
-            if (! is_array($value)) {
112
+        return collect($builder->wheres)->map(function($value, $key) use ($operators) {
113
+            if ( ! is_array($value)) {
114 114
                 if (Str::endsWith($key, $operators) || Str::startsWith($value, $operators)) {
115 115
                     return $key.' '.$value;
116 116
                 }
Please login to merge, or discard this patch.
src/Jobs/DeleteJob.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 
55 55
         $result = $index->deleteBy([
56 56
             'tagFilters' => [
57
-                $this->searchables->map(function ($searchable) {
57
+                $this->searchables->map(function($searchable) {
58 58
                     return ObjectIdEncrypter::encrypt($searchable);
59 59
                 })->toArray(),
60 60
             ],
Please login to merge, or discard this patch.
src/Repositories/LocalSettingsRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
             return app('path.config').DIRECTORY_SEPARATOR.$fileName;
78 78
         }
79 79
 
80
-        if (! $this->files->exists($settingsPath)) {
80
+        if ( ! $this->files->exists($settingsPath)) {
81 81
             $this->files->makeDirectory($settingsPath, 0755, true);
82 82
         }
83 83
 
Please login to merge, or discard this patch.
src/ScoutExtendedServiceProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -59,30 +59,30 @@  discard block
 block discarded – undo
59 59
      */
60 60
     private function registerBinds(): void
61 61
     {
62
-        $this->app->bind(Algolia::class, function () {
62
+        $this->app->bind(Algolia::class, function() {
63 63
             return new Algolia($this->app);
64 64
         });
65 65
 
66 66
         $this->app->alias(Algolia::class, 'algolia');
67 67
 
68
-        $this->app->singleton(EngineManager::class, function ($app) {
68
+        $this->app->singleton(EngineManager::class, function($app) {
69 69
             return new EngineManager($app);
70 70
         });
71 71
 
72 72
         $this->app->alias(EngineManager::class, \Laravel\Scout\EngineManager::class);
73 73
 
74
-        $this->app->bind(AlgoliaEngine::class, function (): AlgoliaEngine {
74
+        $this->app->bind(AlgoliaEngine::class, function(): AlgoliaEngine {
75 75
             return $this->app->make(\Laravel\Scout\EngineManager::class)->createAlgoliaDriver();
76 76
         });
77 77
 
78 78
         $this->app->alias(AlgoliaEngine::class, 'algolia.engine');
79
-        $this->app->bind(SearchClient::class, function (): SearchClient {
79
+        $this->app->bind(SearchClient::class, function(): SearchClient {
80 80
             return $this->app->make('algolia.engine')->getClient();
81 81
         });
82 82
 
83 83
         $this->app->alias(SearchClient::class, 'algolia.client');
84 84
 
85
-        $this->app->bind(AnalyticsClient::class, function (): AnalyticsClient {
85
+        $this->app->bind(AnalyticsClient::class, function(): AnalyticsClient {
86 86
             return AnalyticsClient::create(config('scout.algolia.id'), config('scout.algolia.secret'));
87 87
         });
88 88
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $this->app->singleton(AggregatorObserver::class, AggregatorObserver::class);
92 92
         $this->app->bind(\Laravel\Scout\Builder::class, Builder::class);
93 93
 
94
-        $this->app->bind(SearchableFinder::class, function () {
94
+        $this->app->bind(SearchableFinder::class, function() {
95 95
             return new SearchableFinder($this->app);
96 96
         });
97 97
     }
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
      */
124 124
     private function registerMacros(): void
125 125
     {
126
-        \Illuminate\Database\Eloquent\Builder::macro('transform', function (array $array, array $transformers = null) {
126
+        \Illuminate\Database\Eloquent\Builder::macro('transform', function(array $array, array $transformers = null) {
127 127
             foreach ($transformers ?? UpdateJob::getTransformers() as $transformer) {
128 128
                 $array = app($transformer)->transform($this->getModel(), $array);
129 129
             }
Please login to merge, or discard this patch.
src/Searchable/ModelsResolver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         foreach ($hits->keys() as $id) {
53 53
             $modelClass = ObjectIdEncrypter::decryptSearchable((string) $id);
54 54
             $modelKey = ObjectIdEncrypter::decryptSearchableKey((string) $id);
55
-            if (! array_key_exists($modelClass, $models)) {
55
+            if ( ! array_key_exists($modelClass, $models)) {
56 56
                 $models[$modelClass] = [];
57 57
             }
58 58
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             $model = new $modelClass;
64 64
 
65 65
             if (in_array(Searchable::class, class_uses_recursive($model), true)) {
66
-                if (! empty($models = $model->getScoutModelsByIds($builder, $modelKeys))) {
66
+                if ( ! empty($models = $model->getScoutModelsByIds($builder, $modelKeys))) {
67 67
                     $instances = $instances->merge($models->load($searchable->getRelations($modelClass)));
68 68
                 }
69 69
             } else {
Please login to merge, or discard this patch.
src/Jobs/UpdateJob.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                 continue;
111 111
             }
112 112
 
113
-            if (! $this->hasToSearchableArray($searchable)) {
113
+            if ( ! $this->hasToSearchableArray($searchable)) {
114 114
                 $array = $searchable->getModel()->transform($array);
115 115
             }
116 116
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     {
150 150
         $class = get_class($searchable->getModel());
151 151
 
152
-        if (! array_key_exists($class, $this->splittables)) {
152
+        if ( ! array_key_exists($class, $this->splittables)) {
153 153
             $this->splittables[$class] = false;
154 154
 
155 155
             foreach ($searchable->toSearchableArray() as $key => $value) {
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
             }
199 199
         }
200 200
 
201
-        if (! empty($result)) {
201
+        if ( ! empty($result)) {
202 202
             if (is_array($result)) {
203 203
                 $objects = [[]];
204 204
                 foreach ($pieces as $splittedBy => $values) {
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
                     $objects = $temp;
212 212
                 }
213 213
 
214
-                return array_map(function ($object) use ($array) {
214
+                return array_map(function($object) use ($array) {
215 215
                     return array_merge($array, $object);
216 216
                 }, $objects);
217 217
             } else {
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
     {
248 248
         $searchableClass = get_class($searchable);
249 249
 
250
-        if (! array_key_exists($searchableClass, $this->searchablesWithToSearchableArray)) {
250
+        if ( ! array_key_exists($searchableClass, $this->searchablesWithToSearchableArray)) {
251 251
             $reflectionClass = new ReflectionClass(get_class($searchable));
252 252
 
253 253
             $this->searchablesWithToSearchableArray[$searchableClass] = ends_with((string) $reflectionClass->getMethod('toSearchableArray')->getFileName(), (string) $reflectionClass->getFileName());
Please login to merge, or discard this patch.
src/Console/Commands/OptimizeCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
         foreach ($searchableFinder->fromCommand($this) as $searchable) {
47 47
             $this->output->text('
Please login to merge, or discard this patch.