Skip to content

Commit acd322f

Browse files
committed
#1930 convert to short closure
1 parent 42aeecb commit acd322f

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
@@ -219,16 +219,15 @@ protected function ensureOrderForCursorPagination($shouldReverse = false)
219219
}
220220

221221
if ($shouldReverse) {
222-
$this->query->orders = collect($this->query->orders)->map(function ($direction) {
223-
return $direction === 1 ? -1 : 1;
224-
})->toArray();
222+
$this->query->orders = collect($this->query->orders)
223+
->map(fn (int $direction) => $direction === 1 ? -1 : 1)
224+
->toArray();
225225
}
226226

227-
return collect($this->query->orders)->map(function ($direction, $column) {
228-
return [
227+
return collect($this->query->orders)
228+
->map(fn ($direction, $column) => [
229229
'column' => $column,
230230
'direction' => $direction === 1 ? 'asc' : 'desc',
231-
];
232-
})->values();
231+
])->values();
233232
}
234233
}

0 commit comments

Comments
 (0)