diff --git a/Services/News/src/Data/LazyNewsCollection.php b/Services/News/src/Data/LazyNewsCollection.php index 80f43c7a02be..a87b9ef2f795 100644 --- a/Services/News/src/Data/LazyNewsCollection.php +++ b/Services/News/src/Data/LazyNewsCollection.php @@ -46,9 +46,9 @@ public function __construct( } /** - * @param \Closure(int[], string[]): NewsItem[] $callback + * @param null|\Closure(int[], string[]): NewsItem[] $callback */ - public function withFetchCallback(\Closure $callback): static + public function withFetchCallback(?\Closure $callback): static { $clone = clone $this; $clone->fetch_callback = $callback; diff --git a/Services/News/src/Persistence/NewsRepository.php b/Services/News/src/Persistence/NewsRepository.php index 508b12274001..e168d924111a 100644 --- a/Services/News/src/Persistence/NewsRepository.php +++ b/Services/News/src/Persistence/NewsRepository.php @@ -154,10 +154,10 @@ public function findByContextsBatch(array $contexts, NewsCriteria $criteria): Ne /** * @param NewsContext[] $contexts */ - public function findByContextsBatchLazy(array $contexts, NewsCriteria $criteria): LazyNewsCollection + public function findByContextsBatchLazy(array $contexts, NewsCriteria $criteria): NewsCollection { if (empty($contexts)) { - return new LazyNewsCollection(); + return new NewsCollection(); } $obj_ids = array_map(fn($context) => $context->getObjId(), $contexts);