From bc9bb0a32bfbf390a48b9055e850723a03e630a3 Mon Sep 17 00:00:00 2001 From: Tony BOTALLA Date: Wed, 30 Jun 2021 08:29:09 +0200 Subject: [PATCH] Run CS fixer --- src/Builders/FilterBuilder.php | 6 ++++++ src/Console/ElasticIndexCreateCommand.php | 2 +- src/Console/Features/RequiresIndexConfiguratorArgument.php | 4 ++-- src/Console/Features/RequiresModelArgument.php | 2 +- src/Indexers/BulkIndexer.php | 1 + src/Searchable.php | 6 +++--- tests/Stubs/Model.php | 2 +- 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/Builders/FilterBuilder.php b/src/Builders/FilterBuilder.php index 312025d..b8d9890 100644 --- a/src/Builders/FilterBuilder.php +++ b/src/Builders/FilterBuilder.php @@ -102,6 +102,7 @@ public function where($field, $value) $field => $value, ], ]; + break; case '>': @@ -112,6 +113,7 @@ public function where($field, $value) ], ], ]; + break; case '<': @@ -122,6 +124,7 @@ public function where($field, $value) ], ], ]; + break; case '>=': @@ -132,6 +135,7 @@ public function where($field, $value) ], ], ]; + break; case '<=': @@ -142,6 +146,7 @@ public function where($field, $value) ], ], ]; + break; case '!=': @@ -151,6 +156,7 @@ public function where($field, $value) $field => $value, ], ]; + break; } diff --git a/src/Console/ElasticIndexCreateCommand.php b/src/Console/ElasticIndexCreateCommand.php index e7cf9f8..de8650b 100644 --- a/src/Console/ElasticIndexCreateCommand.php +++ b/src/Console/ElasticIndexCreateCommand.php @@ -59,7 +59,7 @@ public function handle() collect(config('scout_elastic.searchable_models', [])) ->filter(function ($indexableClass) { - $model = new $indexableClass; + $model = new $indexableClass(); return method_exists($model, 'getIndexConfigurator') && get_class($model->getIndexConfigurator()) === get_class($this->configurator); })->each(function ($class) { diff --git a/src/Console/Features/RequiresIndexConfiguratorArgument.php b/src/Console/Features/RequiresIndexConfiguratorArgument.php index 6332688..9f16fdd 100644 --- a/src/Console/Features/RequiresIndexConfiguratorArgument.php +++ b/src/Console/Features/RequiresIndexConfiguratorArgument.php @@ -16,7 +16,7 @@ protected function getIndexConfigurator() { $configuratorClass = trim($this->argument('index-configurator')); - $configuratorInstance = new $configuratorClass; + $configuratorInstance = new $configuratorClass(); if (! ($configuratorInstance instanceof IndexConfigurator)) { throw new InvalidArgumentException(sprintf( @@ -26,6 +26,6 @@ protected function getIndexConfigurator() )); } - return new $configuratorClass; + return new $configuratorClass(); } } diff --git a/src/Console/Features/RequiresModelArgument.php b/src/Console/Features/RequiresModelArgument.php index a74b044..d2b2302 100644 --- a/src/Console/Features/RequiresModelArgument.php +++ b/src/Console/Features/RequiresModelArgument.php @@ -18,7 +18,7 @@ protected function getModel() { $modelClass = trim($this->argument('model')); - $modelInstance = new $modelClass; + $modelInstance = new $modelClass(); if ( ! ($modelInstance instanceof Model) || diff --git a/src/Indexers/BulkIndexer.php b/src/Indexers/BulkIndexer.php index 3382ddd..e21e601 100644 --- a/src/Indexers/BulkIndexer.php +++ b/src/Indexers/BulkIndexer.php @@ -20,6 +20,7 @@ public function update(Collection $models) $model = $models->first(); $indexConfigurator = $model->getIndexConfigurator(); $this->configurator = $indexConfigurator; + try { // Use name of new index created by elastic:create-index command $indexName = resolve('elasticIndexCreated'); diff --git a/src/Searchable.php b/src/Searchable.php index ac79c5e..322e8b2 100644 --- a/src/Searchable.php +++ b/src/Searchable.php @@ -63,7 +63,7 @@ public function getIndexConfigurator() } $indexConfiguratorClass = $this->indexConfigurator; - $indexConfigurator = new $indexConfiguratorClass; + $indexConfigurator = new $indexConfiguratorClass(); } return $indexConfigurator; @@ -92,9 +92,9 @@ public static function search($query, $callback = null) $softDelete = static::usesSoftDelete() && config('scout.soft_delete', false); if ($query == '*') { - return new FilterBuilder(new static, $callback, $softDelete); + return new FilterBuilder(new static(), $callback, $softDelete); } else { - return new SearchBuilder(new static, $query, $callback, $softDelete); + return new SearchBuilder(new static(), $query, $callback, $softDelete); } } diff --git a/tests/Stubs/Model.php b/tests/Stubs/Model.php index d8e07e0..cbae4ec 100644 --- a/tests/Stubs/Model.php +++ b/tests/Stubs/Model.php @@ -7,5 +7,5 @@ class Model extends \Illuminate\Database\Eloquent\Model { - use Searchable, SoftDeletes; + use Searchable;use SoftDeletes; }