From e4d13fe151b9506c05d784cc56bfb74009fbaaab Mon Sep 17 00:00:00 2001 From: Michael Aerni Date: Thu, 18 Jul 2024 14:48:39 -0400 Subject: [PATCH] Simplify with mapInto --- src/Sitemaps/SitemapRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Sitemaps/SitemapRepository.php b/src/Sitemaps/SitemapRepository.php index 9910f63b..999baece 100644 --- a/src/Sitemaps/SitemapRepository.php +++ b/src/Sitemaps/SitemapRepository.php @@ -53,7 +53,7 @@ public function collectionSitemaps(): Collection { return CollectionFacade::all() ->filter(IsEnabledModel::handle(...)) - ->map(fn ($collection) => new CollectionSitemap($collection)) + ->mapInto(CollectionSitemap::class) ->values(); } @@ -61,7 +61,7 @@ public function taxonomySitemaps(): Collection { return Taxonomy::all() ->filter(IsEnabledModel::handle(...)) - ->map(fn ($taxonomy) => new TaxonomySitemap($taxonomy)) + ->mapInto(TaxonomySitemap::class) ->values(); }