Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #150 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 249 254 +5
===========================================
Files 35 35
Lines 615 634 +19
===========================================
+ Hits 615 634 +19 ☔ View full report in Codecov by Sentry. |
PR SummaryThis Pull Request focuses on improving the functionality and efficiency of both the
|
|
Too many changes for one PR. You should consider breaking it down into several |
roxblnfk
left a comment
There was a problem hiding this comment.
I'm not sure that BC is necessary for this package
| * @extends ReadableDataInterface<TKey, TValue> | ||
| */ | ||
| interface PaginatorInterface | ||
| interface PaginatorInterface extends ReadableDataInterface |
There was a problem hiding this comment.
Are you sure that PaginatorInterface::read() and ReaderInterface::read() are compatible in the meaning?
/**
* Get iterable for the data set.
*
* @return iterable Iterable for the data.
* @psalm-return iterable<TKey, TValue>
*/
public function read(): iterable; /**
* Get iterator that could be used to read currently active page items.
*
* @throws PaginatorException If page specified is not found.
*
* @return iterable Iterator with items for the current page.
* @psalm-return iterable<TKey, TValue>
*/
public function read(): iterable;There was a problem hiding this comment.
By the way, this was the main reason why the Paginator didn't implement the DataReaderInterface from the very beginning.
This could lead to confusion and unexpected behavior. One user might expect that passing a Paginator would read all the data, while another user might expect it to read only one page.
There was a problem hiding this comment.
I don't understand reason. You talk about implementation details. For users of ReadableDataInterface it doesn't matter.
Co-authored-by: Aleksei Gagarin <roxblnfk@ya.ru>
This is related changes that don't make sense individually.
These changes cannot be made without breack BC. |
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
| /** | ||
| * Data that could be limited. | ||
| */ | ||
| interface LimitableDataInterface |
There was a problem hiding this comment.
It would be nice to add "extends ReadableInterface" there
withLimit()fromReadableDataInterfacetoLimitableDataInterface.PaginatorInterfaceextendsReadableDataInterface