Skip to content

Commit

Permalink
Fixed nullable setters for news criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Jan 30, 2024
1 parent 731a8c8 commit b88d947
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/Criteria/NewsCriteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,19 +275,27 @@ public function setExcludedNews(array $newsIds): self
/**
* Set the limit.
*/
public function setLimit(int $limit): self
public function setLimit(int|null $limit): self
{
$this->options['limit'] = $limit;
if (null === $limit) {
unset($this->options['limit']);
} else {
$this->options['limit'] = $limit;
}

return $this;
}

/**
* Set the offset.
*/
public function setOffset(int $offset): self
public function setOffset(int|null $offset): self
{
$this->options['offset'] = $offset;
if (null === $offset) {
unset($this->options['offset']);
} else {
$this->options['offset'] = $offset;
}

return $this;
}
Expand Down

0 comments on commit b88d947

Please sign in to comment.