diff --git a/src/Home/HomeRoutes.php b/src/Home/HomeRoutes.php index b861ca5..4433626 100644 --- a/src/Home/HomeRoutes.php +++ b/src/Home/HomeRoutes.php @@ -53,14 +53,14 @@ class HomeRoutes extends RouteHandler { private array $newsCategoryInfos = []; - private function getFeaturedNewsPosts(int $amount, bool $decorate): array { + private function getFeaturedNewsPosts(int $amount, bool $decorate): iterable { $postInfos = $this->news->getPosts( onlyFeatured: true, pagination: new Pagination($amount) ); if(!$decorate) - return $postInfos; + return iterator_to_array($postInfos); $posts = []; @@ -221,7 +221,7 @@ class HomeRoutes extends RouteHandler { } else $linkedData = null; $stats = $this->getStats(); - $onlineUserInfos = $this->getOnlineUsers(); + $onlineUserInfos = iterator_to_array($this->getOnlineUsers()); $featuredNews = $this->getFeaturedNewsPosts(3, false); $popularTopics = $this->getPopularForumTopics($config['landing.forum_categories']); $activeTopics = $this->getActiveForumTopics($config['landing.forum_categories']);