Skip to content

Commit

Permalink
StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
carloeusebi committed Jan 22, 2025
1 parent 02c6be3 commit 1f4f87c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ public function incrementOrCreate(array $attributes, string $column = 'count', $
return tap($this->firstOrCreate($attributes, [$column => $default]), function ($instance) use ($column, $step, $extra) {
if (! $instance->wasRecentlyCreated) {
$instance->increment($column, $step, $extra);
}
}
});
}

Expand Down
11 changes: 7 additions & 4 deletions tests/Database/DatabaseEloquentBuilderCreateOrFirstTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ public function testUpdateOrCreateMethodUpdatesRecordCreatedJustNow(): void
], $result->toArray());
}

public function testIncrementOrCreateMethodIncrementsExistingRecord(): void {
public function testIncrementOrCreateMethodIncrementsExistingRecord(): void
{
$model = new EloquentBuilderCreateOrFirstTestModel();
$this->mockConnectionForModel($model, 'SQLite');
$model->getConnection()->shouldReceive('transactionLevel')->andReturn(0);
Expand Down Expand Up @@ -341,7 +342,8 @@ public function testIncrementOrCreateMethodIncrementsExistingRecord(): void {
], $result->toArray());
}

public function testIncrementOrCreateMethodCreatesNewRecord(): void {
public function testIncrementOrCreateMethodCreatesNewRecord(): void
{
$model = new EloquentBuilderCreateOrFirstTestModel();
$this->mockConnectionForModel($model, 'SQLite', [123]);
$model->getConnection()->shouldReceive('transactionLevel')->andReturn(0);
Expand Down Expand Up @@ -412,7 +414,8 @@ public function testIncrementOrCreateMethodIncrementParametersArePassed(): void
], $result->toArray());
}

public function testIncrementOrCreateMethodRetrievesRecordCreatedJustNow(): void {
public function testIncrementOrCreateMethodRetrievesRecordCreatedJustNow(): void
{
$model = new EloquentBuilderCreateOrFirstTestModel();
$this->mockConnectionForModel($model, 'SQLite');
$model->getConnection()->shouldReceive('transactionLevel')->andReturn(0);
Expand All @@ -437,7 +440,7 @@ public function testIncrementOrCreateMethodRetrievesRecordCreatedJustNow(): void
->andReturn([[
'id' => 123,
'attr' => 'foo',
'count' => 1 ,
'count' => 1,
'created_at' => '2023-01-01 00:00:00',
'updated_at' => '2023-01-01 00:00:00',
]]);
Expand Down

0 comments on commit 1f4f87c

Please sign in to comment.