Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Services/News/src/Data/LazyNewsCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Services/News/src/Persistence/NewsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down