Skip to content

Commit 3cf9805

Browse files
Convert closures to arrow functions in the Model class (#54599)
1 parent 8b1eb6d commit 3cf9805

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/Illuminate/Database/Eloquent/Model.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,9 +1058,9 @@ public function updateQuietly(array $attributes = [], array $options = [])
10581058
*/
10591059
protected function incrementQuietly($column, $amount = 1, array $extra = [])
10601060
{
1061-
return static::withoutEvents(function () use ($column, $amount, $extra) {
1062-
return $this->incrementOrDecrement($column, $amount, $extra, 'increment');
1063-
});
1061+
return static::withoutEvents(
1062+
fn () => $this->incrementOrDecrement($column, $amount, $extra, 'increment')
1063+
);
10641064
}
10651065

10661066
/**
@@ -1073,9 +1073,9 @@ protected function incrementQuietly($column, $amount = 1, array $extra = [])
10731073
*/
10741074
protected function decrementQuietly($column, $amount = 1, array $extra = [])
10751075
{
1076-
return static::withoutEvents(function () use ($column, $amount, $extra) {
1077-
return $this->incrementOrDecrement($column, $amount, $extra, 'decrement');
1078-
});
1076+
return static::withoutEvents(
1077+
fn () => $this->incrementOrDecrement($column, $amount, $extra, 'decrement')
1078+
);
10791079
}
10801080

10811081
/**
@@ -1732,10 +1732,10 @@ public function refresh()
17321732
->attributes
17331733
);
17341734

1735-
$this->load((new BaseCollection($this->relations))->reject(function ($relation) {
1736-
return $relation instanceof Pivot
1737-
|| (is_object($relation) && in_array(AsPivot::class, class_uses_recursive($relation), true));
1738-
})->keys()->all());
1735+
$this->load((new BaseCollection($this->relations))->reject(
1736+
fn ($relation) => $relation instanceof Pivot
1737+
|| (is_object($relation) && in_array(AsPivot::class, class_uses_recursive($relation), true))
1738+
)->keys()->all());
17391739

17401740
$this->syncOriginal();
17411741

0 commit comments

Comments
 (0)