File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111- Summarize Search option enabled by default (without possibility to disable it) ([ Issue #26 ] )
1212- Highlight Search option enabled by default (without possibility to disable it) ([ Issue #26 ] )
1313- Fix error when parsing response from Search with NOCONTENT flag
14+ - Make PaginatedResponse ` valid ` iterator function work
1415
1516## [ 2.1.0]
1617
Original file line number Diff line number Diff line change @@ -109,14 +109,19 @@ public function key()
109109 return 0 ;
110110 }
111111
112- return (int ) floor (($ this ->lastCommand ->getOffset () ?? 0 ) / $ this ->getPageSize ());
112+ return (int ) floor (($ this ->lastCommand ->getOffset () ?? $ this -> requestedOffset ?? 0 ) / $ this ->getPageSize ());
113113 }
114114
115115 public function valid ()
116116 {
117- return $ this ->requestedOffset >= 0
118- && $ this ->requestedSize > 0
119- && $ this ->requestedOffset < $ this ->totalCount ;
117+ return (
118+ null === $ this ->requestedOffset
119+ && null === $ this ->requestedSize
120+ ) || (
121+ $ this ->requestedOffset >= 0
122+ && $ this ->requestedSize > 0
123+ && $ this ->requestedOffset < $ this ->totalCount
124+ );
120125 }
121126
122127 public function rewind (): void
You can’t perform that action at this time.
0 commit comments