Skip to content

Commit 4d1f6ab

Browse files
authored
Sort report pages by canonical URL (#311)
1 parent f8f56a1 commit 4d1f6ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Reporting/Report.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ public function withPages($preferCache = false)
279279

280280
$this->pages = collect($files)
281281
->map(fn ($file) => YAML::parse(File::get($file)))
282-
->map(fn ($yaml) => (new Page($yaml['id'], $yaml['data'], $this))->setResults($yaml['results']));
282+
->map(fn ($yaml) => (new Page($yaml['id'], $yaml['data'], $this))->setResults($yaml['results']))
283+
->sortBy
284+
->url()
285+
->values();
283286

284287
if ($this->isGenerated()) {
285288
Cache::put($this->cacheKey(static::PAGES_CACHE_KEY_SUFFIX), $this->pages);

0 commit comments

Comments
 (0)