1111use App \Models \Service ;
1212use App \Sitemap \SitemapBuilder ;
1313use Illuminate \Http \Response ;
14+ use Illuminate \Support \Collection ;
1415use Illuminate \Support \Facades \Cache ;
1516
1617class SitemapController extends Controller
@@ -55,7 +56,8 @@ private function builder(): void
5556 // Use chunked queries to prevent memory issues
5657 News::whereNotNull ('published_at ' )
5758 ->with ('references ' )
58- ->chunk (100 , function ($ news ) {
59+ ->chunk (100 , function (Collection $ news ): void {
60+ /** @var News $item */
5961 foreach ($ news as $ item ) {
6062 $ this ->addLocalizedPageSet (
6163 page: (new PageAction (locale: null , routeName: null ))->news (news: $ item , withReferences: true ),
@@ -65,7 +67,8 @@ private function builder(): void
6567
6668 Service::where ('published ' , true )
6769 ->with ('references ' )
68- ->chunk (100 , function ($ services ) {
70+ ->chunk (100 , function (Collection $ services ): void {
71+ /** @var Service $item */
6972 foreach ($ services as $ item ) {
7073 $ this ->addLocalizedPageSet (
7174 page: (new PageAction (locale: null , routeName: null ))->service (service: $ item , withReferences: true ),
@@ -75,7 +78,8 @@ private function builder(): void
7578
7679 Product::where ('published ' , true )
7780 ->with ('references ' )
78- ->chunk (100 , function ($ products ) {
81+ ->chunk (100 , function (Collection $ products ): void {
82+ /** @var Product $item */
7983 foreach ($ products as $ item ) {
8084 $ this ->addLocalizedPageSet (
8185 page: (new PageAction (locale: null , routeName: null ))->product (product: $ item , withReferences: true ),
0 commit comments