Skip to content

Commit 529daab

Browse files
OleVikGrotax
authored andcommitted
Update Result.php
1 parent cbed6f7 commit 529daab

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/FeedIo/Reader/Result.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Result
3232
public function __construct(
3333
protected Document $document,
3434
protected FeedInterface $feed,
35-
protected DateTime $modifiedSince,
35+
protected ?DateTime $modifiedSince = null,
3636
protected ResponseInterface $response,
3737
protected string $url
3838
) {
@@ -56,8 +56,15 @@ public function getFeed(): FeedInterface
5656

5757
public function getItemsSince(DateTime $since = null): iterable
5858
{
59+
$startDate = $since ?? $this->modifiedSince;
60+
61+
// return all items if no start date is given
62+
if ($startDate === null) {
63+
return $this->feed;
64+
}
65+
5966
$filter = new Chain();
60-
$filter->add(new Since($since ?? $this->modifiedSince));
67+
$filter->add(new Since($startDate));
6168

6269
return $filter->filter($this->getFeed());
6370
}

0 commit comments

Comments
 (0)