We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2b6183 commit 1cbf94cCopy full SHA for 1cbf94c
src/MessageQuery.php
@@ -258,9 +258,10 @@ protected function populate(Collection $uids): MessageCollection
258
*/
259
protected function fetch(Collection $messages): array
260
{
261
- if ($this->fetchOrder === 'desc') {
262
- $messages = $messages->reverse();
263
- }
+ $messages = match ($this->fetchOrder) {
+ 'asc' => $messages->sort(SORT_NUMERIC),
+ 'desc' => $messages->sortDesc(SORT_NUMERIC),
264
+ };
265
266
$uids = $messages->forPage($this->page, $this->limit)->toArray();
267
0 commit comments