diff --git a/src/LogFileCollection.php b/src/LogFileCollection.php index d2b9621b..23a44ec5 100644 --- a/src/LogFileCollection.php +++ b/src/LogFileCollection.php @@ -14,7 +14,7 @@ public function sortByEarliestFirst(): self { $this->items = $this->sortBy(function (LogFile $file) { return $file->earliestTimestamp().($file->name ?? ''); - }, SORT_NATURAL)->values()->toArray(); + }, SORT_NATURAL)->values()->all(); return $this; } @@ -23,21 +23,21 @@ public function sortByLatestFirst(): self { $this->items = $this->sortByDesc(function (LogFile $file) { return $file->latestTimestamp().($file->name ?? ''); - }, SORT_NATURAL)->values()->toArray(); + }, SORT_NATURAL)->values()->all(); return $this; } public function sortAlphabeticallyAsc(): self { - $this->items = $this->sortBy('name')->values()->toArray(); + $this->items = $this->sortBy('name')->values()->all(); return $this; } public function sortAlphabeticallyDesc(): self { - $this->items = $this->sortByDesc('name')->values()->toArray(); + $this->items = $this->sortByDesc('name')->values()->all(); return $this; } diff --git a/src/LogFolderCollection.php b/src/LogFolderCollection.php index 7fdf0474..394f5038 100644 --- a/src/LogFolderCollection.php +++ b/src/LogFolderCollection.php @@ -18,14 +18,14 @@ public static function fromFiles($files = []): LogFolderCollection public function sortByEarliestFirst(): self { - $this->items = $this->sortBy->earliestTimestamp()->values()->toArray(); + $this->items = $this->sortBy->earliestTimestamp()->values()->all(); return $this; } public function sortByLatestFirst(): self { - $this->items = $this->sortByDesc->latestTimestamp()->values()->toArray(); + $this->items = $this->sortByDesc->latestTimestamp()->values()->all(); return $this; } @@ -60,7 +60,7 @@ public function sortAlphabeticallyAsc(): self return strcmp($a->cleanPath(), $b->cleanPath()); }) ->values() - ->toArray(); + ->all(); return $this; } @@ -79,7 +79,7 @@ public function sortAlphabeticallyDesc(): self return strcmp($b->cleanPath(), $a->cleanPath()); }) ->values() - ->toArray(); + ->all(); return $this; }