File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments