Skip to content

Commit 22ade76

Browse files
limenetactions-user
authored andcommitted
Fix styling
1 parent 6efad81 commit 22ade76

19 files changed

+29
-40
lines changed

src/Commands/IndexCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ public function handle()
5656
$this->info(sprintf('Indexing %s', $indexConfig->getName()));
5757

5858
Bus::batch([
59-
[new SetupIndex($indexConfig, (bool) $this->option('delete'))],
60-
[new PopulateIndex($indexConfig)],
61-
])
59+
[new SetupIndex($indexConfig, (bool) $this->option('delete'))],
60+
[new PopulateIndex($indexConfig)],
61+
])
6262
->onConnection(config('elastica-bridge.connection'))
6363
->then(function () use ($indexConfig): void {
6464
ActivateIndex::dispatch($indexConfig)

src/Commands/StatusCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,6 @@ protected function formatBytes(int $bytes): string
120120
$base = log($bytes, 1024);
121121
$suffixes = ['', 'K', 'M', 'G', 'T'];
122122

123-
return round(1024 ** ($base - floor($base)), 2).' '.$suffixes[(int)floor($base)].'B';
123+
return round(1024 ** ($base - floor($base)), 2).' '.$suffixes[(int) floor($base)].'B';
124124
}
125125
}

src/Jobs/PopulateIndex.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public function handle(): void
4545
}
4646
}
4747

48-
4948
$this->batch()->add($jobs);
5049

5150
$index->refresh();

src/LaravelElasticaBridgeServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function configurePackage(Package $package): void
2424
->hasCommands([IndexCommand::class, StatusCommand::class]);
2525
}
2626

27-
public function packageRegistered():void
27+
public function packageRegistered(): void
2828
{
2929
$this->app->singleton(ElasticaClient::class);
3030
$this->app->tag(config('elastica-bridge.indices'), 'elasticaBridgeIndices');

src/Model/ElasticsearchableTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public function toElasticaDocument(IndexInterface $indexConfig): Document
3030
array_merge(
3131
$this->toElasticsearch($indexConfig),
3232
[
33-
IndexInterface::DOCUMENT_MODEL_CLASS => $this::class,
34-
IndexInterface::DOCUMENT_MODEL_ID => $this->id,
35-
]
33+
IndexInterface::DOCUMENT_MODEL_CLASS => $this::class,
34+
IndexInterface::DOCUMENT_MODEL_ID => $this->id,
35+
]
3636
)
3737
);
3838
}

tests/App/Elasticsearch/AllIndex.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
43
namespace Limenet\LaravelElasticaBridge\Tests\App\Elasticsearch;
54

65
use Limenet\LaravelElasticaBridge\Index\AbstractIndex;

tests/App/Elasticsearch/CustomerIndex.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
43
namespace Limenet\LaravelElasticaBridge\Tests\App\Elasticsearch;
54

65
use Limenet\LaravelElasticaBridge\Index\AbstractIndex;
@@ -21,11 +20,11 @@ public function getAllowedDocuments(): array
2120
public function getMapping(): array
2221
{
2322
return [
24-
'properties' => [
23+
'properties' => [
2524
'group' => [
2625
'type' => 'keyword',
2726
],
28-
],
27+
],
2928
];
3029
}
3130
}

tests/App/Elasticsearch/OrderIndex.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
43
namespace Limenet\LaravelElasticaBridge\Tests\App\Elasticsearch;
54

65
use Limenet\LaravelElasticaBridge\Index\AbstractIndex;

tests/App/Elasticsearch/ProductIndex.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
43
namespace Limenet\LaravelElasticaBridge\Tests\App\Elasticsearch;
54

65
use Limenet\LaravelElasticaBridge\Index\AbstractIndex;

tests/Feature/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected function cleanupIndices()
5757
}
5858
}
5959

60-
protected function index(IndexInterface $index):int
60+
protected function index(IndexInterface $index): int
6161
{
6262
return $this->artisan('elastica-bridge:index', ['index' => [$index->getName()]])->run();
6363
}

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function getEnvironmentSetUp($app)
4343
config()->set('elastica-bridge.elasticseach.port', 9200);
4444
}
4545

46-
protected function defineDatabaseMigrations():void
46+
protected function defineDatabaseMigrations(): void
4747
{
4848
include_once __DIR__.'/database/migrations/SetupTables.php';
4949
(new SetupTables())->up();

tests/Unit/ClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class ClientTest extends TestCase
88
{
99
protected ElasticaClient $elasticaClient;
1010

11-
public function setUp():void
11+
public function setUp(): void
1212
{
1313
parent::setUp();
1414

tests/Unit/IndexTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class IndexTest extends TestCase
1717
protected CustomerIndex $customerIndex;
1818
protected ProductIndex $productIndex;
1919

20-
public function setUp():void
20+
public function setUp(): void
2121
{
2222
parent::setUp();
2323

@@ -59,7 +59,7 @@ public function settings_Default()
5959
public function document_to_model()
6060
{
6161
Customer::all()
62-
->each(function (Customer $customer):void {
62+
->each(function (Customer $customer): void {
6363
$document = $customer->toElasticaDocument($this->customerIndex);
6464
$model = $this->customerIndex->getModelInstance($document);
6565
$this->assertInstanceOf(Customer::class, $model);

tests/Unit/ModelTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ModelTest extends TestCase
1414
protected CustomerIndex $customerIndex;
1515
protected ProductIndex $productIndex;
1616

17-
public function setUp():void
17+
public function setUp(): void
1818
{
1919
parent::setUp();
2020

@@ -25,8 +25,8 @@ public function setUp():void
2525
public function convert_to_elastica_document_customized()
2626
{
2727
Customer::all()
28-
->filter(fn (Customer $customer):bool => $customer->shouldIndex($this->customerIndex))
29-
->each(function (Customer $customer):void {
28+
->filter(fn (Customer $customer): bool => $customer->shouldIndex($this->customerIndex))
29+
->each(function (Customer $customer): void {
3030
$document = $customer->toElasticaDocument($this->customerIndex);
3131
$this->assertInstanceOf(Document::class, $document);
3232

@@ -35,7 +35,7 @@ public function convert_to_elastica_document_customized()
3535
$this->assertSame($customer->type, $document->get('type'));
3636

3737
$this->assertStringContainsString('|'.$customer->id, $document->getId());
38-
$this->assertStringContainsString($customer::class . '|', $document->getId());
38+
$this->assertStringContainsString($customer::class.'|', $document->getId());
3939

4040
$this->assertSame($customer->id, $document->get(IndexInterface::DOCUMENT_MODEL_ID));
4141
$this->assertSame($customer::class, $document->get(IndexInterface::DOCUMENT_MODEL_CLASS));
@@ -45,15 +45,15 @@ public function convert_to_elastica_document_customized()
4545
public function convert_to_elastica_document_default()
4646
{
4747
Product::all()
48-
->filter(fn (Product $product):bool => $product->shouldIndex($this->productIndex))
49-
->each(function (Product $product):void {
48+
->filter(fn (Product $product): bool => $product->shouldIndex($this->productIndex))
49+
->each(function (Product $product): void {
5050
$document = $product->toElasticaDocument($this->productIndex);
5151
$this->assertInstanceOf(Document::class, $document);
5252

5353
$this->assertSame($product->name, $document->get('name'));
5454

5555
$this->assertStringContainsString('|'.$product->id, $document->getId());
56-
$this->assertStringContainsString($product::class . '|', $document->getId());
56+
$this->assertStringContainsString($product::class.'|', $document->getId());
5757

5858
$this->assertSame($product->id, $document->get(IndexInterface::DOCUMENT_MODEL_ID));
5959
$this->assertSame($product::class, $document->get(IndexInterface::DOCUMENT_MODEL_CLASS));

tests/Unit/RepositoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class RepositoryTest extends TestCase
1313
protected ProductIndex $productIndex;
1414
protected IndexRepository $indexRepository;
1515

16-
public function setUp():void
16+
public function setUp(): void
1717
{
1818
parent::setUp();
1919

tests/database/factories/CustomerFactory.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@ class CustomerFactory extends Factory
1616

1717
/**
1818
* Define the model's default state.
19-
*
20-
* @return array
2119
*/
22-
public function definition():array
20+
public function definition(): array
2321
{
2422
return [
2523
'name' => $this->faker->name(),
2624
'email' => $this->faker->unique()->safeEmail(),
27-
'type' => $this->faker->randomElement(['small','medium','big']),
25+
'type' => $this->faker->randomElement(['small', 'medium', 'big']),
2826
];
2927
}
3028
}

tests/database/factories/ProductFactory.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ class ProductFactory extends Factory
1616

1717
/**
1818
* Define the model's default state.
19-
*
20-
* @return array
2119
*/
22-
public function definition():array
20+
public function definition(): array
2321
{
2422
return [
2523
'name' => $this->faker->words(3, true),

tests/database/migrations/SetupTables.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class SetupTables extends Migration
88
{
9-
public function up():void
9+
public function up(): void
1010
{
1111
Schema::create('customers', function (Blueprint $table) {
1212
$table->id();
@@ -61,4 +61,4 @@ public function up():void
6161
$table->integer('finished_at')->nullable();
6262
});
6363
}
64-
};
64+
}

tests/database/seeders/DatabaseSeeder.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ class DatabaseSeeder extends Seeder
1010
{
1111
/**
1212
* Run the database seeders.
13-
*
14-
* @return void
1513
*/
16-
public function run():void
14+
public function run(): void
1715
{
1816
Customer::factory()->count(50)->create();
1917
Product::factory()->count(50)->create();

0 commit comments

Comments
 (0)