Skip to content

Commit 9af8bed

Browse files
committed
#1930 convert to short closure
1 parent 8bb8bf2 commit 9af8bed

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/Eloquent/Builder.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,15 @@ protected function ensureOrderForCursorPagination($shouldReverse = false)
228228
}
229229

230230
if ($shouldReverse) {
231-
$this->query->orders = collect($this->query->orders)->map(function ($direction) {
232-
return $direction === 1 ? -1 : 1;
233-
})->toArray();
231+
$this->query->orders = collect($this->query->orders)
232+
->map(fn (int $direction) => $direction === 1 ? -1 : 1)
233+
->toArray();
234234
}
235235

236-
return collect($this->query->orders)->map(function ($direction, $column) {
237-
return [
236+
return collect($this->query->orders)
237+
->map(fn ($direction, $column) => [
238238
'column' => $column,
239239
'direction' => $direction === 1 ? 'asc' : 'desc',
240-
];
241-
})->values();
240+
])->values();
242241
}
243242
}

0 commit comments

Comments
 (0)