Passed
Pull Request — master (#121)
by Mark
09:55
created
src/Console/Commands/StatusCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
 
60 60
             $status = $synchronizer->analyse($index);
61 61
             $description = $status->toHumanString();
62
-            if (! $status->bothAreEqual()) {
62
+            if ( ! $status->bothAreEqual()) {
63 63
                 $description = "<fg=red>$description</>";
64 64
             } else {
65 65
                 $description = '<fg=green>Synchronized</>';
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
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         foreach ($ids as $id) {
43 43
             $modelClass = ObjectIdEncrypter::decryptSearchable($id);
44 44
             $modelKey = ObjectIdEncrypter::decryptSearchableKey($id);
45
-            if (! array_key_exists($modelClass, $models)) {
45
+            if ( ! array_key_exists($modelClass, $models)) {
46 46
                 $models[$modelClass] = [];
47 47
             }
48 48
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
             $model = new $modelClass;
54 54
 
55 55
             if (in_array(Searchable::class, class_uses_recursive($model), true)) {
56
-                if (! empty($models = $model->getScoutModelsByIds($builder, $modelKeys))) {
56
+                if ( ! empty($models = $model->getScoutModelsByIds($builder, $modelKeys))) {
57 57
                     $instances = $instances->merge($models);
58 58
                 }
59 59
             } else {
Please login to merge, or discard this patch.
src/Console/Commands/ImportCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         foreach ($searchableFinder->fromCommand($this) as $searchable) {
43 43
             $this->call('scout:flush', ['searchable' => $searchable]);
44 44
 
45
-            $events->listen(ModelsImported::class, function ($event) use ($searchable) {
45
+            $events->listen(ModelsImported::class, function($event) use ($searchable) {
46 46
                 $this->resultMessage($event->models, $searchable);
47 47
             });
48 48
 
Please login to merge, or discard this patch.
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
@@ -108,8 +108,8 @@
 block discarded – undo
108 108
     {
109 109
         $operators = ['<', '<=', '=', '!=', '>=', '>', ':'];
110 110
 
111
-        return collect($builder->wheres)->map(function ($value, $key) use ($operators) {
112
-            if (! is_array($value)) {
111
+        return collect($builder->wheres)->map(function($value, $key) use ($operators) {
112
+            if ( ! is_array($value)) {
113 113
                 if (ends_with($key, $operators) || starts_with($value, $operators)) {
114 114
                     return $key.' '.$value;
115 115
                 }
Please login to merge, or discard this patch.
src/Searchable/Aggregator.php 1 patch
Spacing   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -151,8 +151,7 @@  discard block
 block discarded – undo
151 151
             throw new ModelNotDefinedInAggregatorException();
152 152
         }
153 153
 
154
-        return method_exists($this->model, 'toSearchableArray') ? $this->model->toSearchableArray() :
155
-            $this->model->toArray();
154
+        return method_exists($this->model, 'toSearchableArray') ? $this->model->toSearchableArray() : $this->model->toArray();
156 155
     }
157 156
 
158 157
     /**
@@ -168,10 +167,10 @@  discard block
 block discarded – undo
168 167
             $softDeletes =
169 168
                 in_array(SoftDeletes::class, class_uses_recursive($model)) && config('scout.soft_delete', false);
170 169
 
171
-            $instance->newQuery()->when($softDeletes, function ($query) {
170
+            $instance->newQuery()->when($softDeletes, function($query) {
172 171
                 $query->withTrashed();
173
-            })->orderBy($instance->getKeyName())->chunk(config('scout.chunk.searchable', 500), function ($models) {
174
-                $models = $models->filter->shouldBeSearchable()->map(function ($model) {
172
+            })->orderBy($instance->getKeyName())->chunk(config('scout.chunk.searchable', 500), function($models) {
173
+                $models = $models->filter->shouldBeSearchable()->map(function($model) {
175 174
                     return static::create($model);
176 175
                 });
177 176
 
@@ -209,7 +208,7 @@  discard block
 block discarded – undo
209 208
             $softDeletes =
210 209
                 in_array(SoftDeletes::class, class_uses_recursive($model), true) && config('scout.soft_delete', false);
211 210
 
212
-            $count += $model::query()->when($softDeletes, function ($query) {
211
+            $count += $model::query()->when($softDeletes, function($query) {
213 212
                 $query->withTrashed();
214 213
             })->count();
215 214
         }
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.