Skip to content
This repository was archived by the owner on Nov 4, 2021. It is now read-only.

Commit c629b3e

Browse files
authored
Remove useless braces. (#318)
1 parent 2cd14d7 commit c629b3e

11 files changed

+34
-34
lines changed

src/Console/ElasticIndexDropCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function handle()
3232
$configurator = $this->getIndexConfigurator();
3333
$indexName = $this->resolveIndexName($configurator);
3434

35-
$payload = (new RawPayload())
35+
$payload = (new RawPayload)
3636
->set('index', $indexName)
3737
->get();
3838

@@ -52,7 +52,7 @@ public function handle()
5252
protected function resolveIndexName($configurator)
5353
{
5454
if (in_array(Migratable::class, class_uses_recursive($configurator))) {
55-
$payload = (new RawPayload())
55+
$payload = (new RawPayload)
5656
->set('name', $configurator->getWriteAlias())
5757
->get();
5858

src/Console/ElasticIndexUpdateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected function createWriteAlias()
8585

8686
$indices = ElasticClient::indices();
8787

88-
$existsPayload = (new RawPayload())
88+
$existsPayload = (new RawPayload)
8989
->set('name', $configurator->getWriteAlias())
9090
->get();
9191

src/Console/ElasticMigrateCommand.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function isTargetIndexExists()
5050
{
5151
$targetIndex = $this->argument('target-index');
5252

53-
$payload = (new RawPayload())
53+
$payload = (new RawPayload)
5454
->set('index', $targetIndex)
5555
->get();
5656

@@ -70,7 +70,7 @@ protected function createTargetIndex()
7070
$sourceIndexConfigurator = $this->getModel()
7171
->getIndexConfigurator();
7272

73-
$payload = (new RawPayload())
73+
$payload = (new RawPayload)
7474
->set('index', $targetIndex)
7575
->setIfNotEmpty('body.settings', $sourceIndexConfigurator->getSettings())
7676
->get();
@@ -97,7 +97,7 @@ protected function updateTargetIndex()
9797
$sourceIndexConfigurator = $this->getModel()
9898
->getIndexConfigurator();
9999

100-
$targetIndexPayload = (new RawPayload())
100+
$targetIndexPayload = (new RawPayload)
101101
->set('index', $targetIndex)
102102
->get();
103103

@@ -107,7 +107,7 @@ protected function updateTargetIndex()
107107
$indices->close($targetIndexPayload);
108108

109109
if ($settings = $sourceIndexConfigurator->getSettings()) {
110-
$targetIndexSettingsPayload = (new RawPayload())
110+
$targetIndexSettingsPayload = (new RawPayload)
111111
->set('index', $targetIndex)
112112
->set('body.settings', $settings)
113113
->get();
@@ -155,7 +155,7 @@ protected function updateTargetIndexMapping()
155155
return;
156156
}
157157

158-
$payload = (new RawPayload())
158+
$payload = (new RawPayload)
159159
->set('index', $targetIndex)
160160
->set('type', $targetType)
161161
->set('include_type_name', 'true')
@@ -179,7 +179,7 @@ protected function updateTargetIndexMapping()
179179
*/
180180
protected function isAliasExists($name)
181181
{
182-
$payload = (new RawPayload())
182+
$payload = (new RawPayload)
183183
->set('name', $name)
184184
->get();
185185

@@ -195,7 +195,7 @@ protected function isAliasExists($name)
195195
*/
196196
protected function getAlias($name)
197197
{
198-
$getPayload = (new RawPayload())
198+
$getPayload = (new RawPayload)
199199
->set('name', $name)
200200
->get();
201201

@@ -218,7 +218,7 @@ protected function deleteAlias($name)
218218
}
219219

220220
foreach ($aliases as $index => $alias) {
221-
$deletePayload = (new RawPayload())
221+
$deletePayload = (new RawPayload)
222222
->set('index', $index)
223223
->set('name', $name)
224224
->get();
@@ -248,7 +248,7 @@ protected function createAliasForTargetIndex($name)
248248
$this->deleteAlias($name);
249249
}
250250

251-
$payload = (new RawPayload())
251+
$payload = (new RawPayload)
252252
->set('index', $targetIndex)
253253
->set('name', $name)
254254
->get();
@@ -293,7 +293,7 @@ protected function deleteSourceIndex()
293293
$aliases = $this->getAlias($sourceIndexConfigurator->getName());
294294

295295
foreach ($aliases as $index => $alias) {
296-
$payload = (new RawPayload())
296+
$payload = (new RawPayload)
297297
->set('index', $index)
298298
->get();
299299

src/ElasticEngine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function buildSearchQueryPayloadCollection(Builder $builder, array $optio
126126
}
127127
} else {
128128
$payload = (new TypePayload($builder->model))
129-
->setIfNotEmpty('body.query.bool.must.match_all', new stdClass());
129+
->setIfNotEmpty('body.query.bool.must.match_all', new stdClass);
130130

131131
$payloadCollection->push($payload);
132132
}

src/Indexers/BulkIndexer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function update(Collection $models)
4242
return true;
4343
}
4444

45-
$actionPayload = (new RawPayload())
45+
$actionPayload = (new RawPayload)
4646
->set('index._id', $model->getScoutKey());
4747

4848
$bulkPayload
@@ -63,7 +63,7 @@ public function delete(Collection $models)
6363
$bulkPayload = new TypePayload($model);
6464

6565
$models->each(function ($model) use ($bulkPayload) {
66-
$actionPayload = (new RawPayload())
66+
$actionPayload = (new RawPayload)
6767
->set('delete._id', $model->getScoutKey());
6868

6969
$bulkPayload->add('body', $actionPayload->get());

src/ScoutElasticServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function boot()
5959
));
6060
}
6161

62-
return new ElasticEngine(new $indexerClass(), $updateMapping);
62+
return new ElasticEngine(new $indexerClass, $updateMapping);
6363
});
6464
}
6565

src/Searchable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public static function search($query, $callback = null)
9999
*/
100100
public static function searchRaw(array $query)
101101
{
102-
$model = new static();
102+
$model = new static;
103103

104104
return $model->searchableUsing()
105105
->searchRaw($model, $query);

tests/ElasticEngineTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public function testBuildFilterQueryPayloadCollection()
184184
'query' => [
185185
'bool' => [
186186
'must' => [
187-
'match_all' => new stdClass(),
187+
'match_all' => new stdClass,
188188
],
189189
'filter' => [
190190
'bool' => [

tests/Indexers/BulkIndexerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function testUpdateWithDisabledSoftDelete()
2626
],
2727
]);
2828

29-
(new BulkIndexer())
29+
(new BulkIndexer)
3030
->update($this->models);
3131

3232
$this->addToAssertionCount(1);
@@ -52,7 +52,7 @@ public function testUpdateWithEnabledSoftDelete()
5252
],
5353
]);
5454

55-
(new BulkIndexer())
55+
(new BulkIndexer)
5656
->update($this->models);
5757

5858
$this->addToAssertionCount(1);
@@ -77,7 +77,7 @@ public function testUpdateWithSpecifiedDocumentRefreshOption()
7777
],
7878
]);
7979

80-
(new BulkIndexer())
80+
(new BulkIndexer)
8181
->update($this->models);
8282

8383
$this->addToAssertionCount(1);
@@ -101,7 +101,7 @@ public function testDelete()
101101
],
102102
]);
103103

104-
(new BulkIndexer())
104+
(new BulkIndexer)
105105
->delete($this->models);
106106

107107
$this->addToAssertionCount(1);

tests/Indexers/SingleIndexerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testUpdateWithDisabledSoftDelete()
3434
],
3535
]);
3636

37-
(new SingleIndexer())
37+
(new SingleIndexer)
3838
->update($this->models);
3939

4040
$this->addToAssertionCount(1);
@@ -78,7 +78,7 @@ public function testUpdateWithEnabledSoftDelete()
7878
],
7979
]);
8080

81-
(new SingleIndexer())
81+
(new SingleIndexer)
8282
->update($this->models);
8383

8484
$this->addToAssertionCount(1);
@@ -112,7 +112,7 @@ public function testUpdateWithSpecifiedDocumentRefreshOption()
112112
],
113113
]);
114114

115-
(new SingleIndexer())
115+
(new SingleIndexer)
116116
->update($this->models);
117117

118118
$this->addToAssertionCount(1);
@@ -152,7 +152,7 @@ public function testDelete()
152152
],
153153
]);
154154

155-
(new SingleIndexer())
155+
(new SingleIndexer)
156156
->delete($this->models);
157157

158158
$this->addToAssertionCount(1);

0 commit comments

Comments
 (0)