Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Dec 8, 2024
1 parent 92dd52c commit 181335a
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
- Bug #195: Fix invalid count in `IterableDataReader` when limit or/and offset used (@vjik)
- Enh #201: Disable sorting when limit is set explicitly in a paginator (@samdark)
- Enh #202: Check that correct sort is passed to `withSort()` of keyset paginator (@samdark)
- Enh #207: More specific Psalm type for OffsetPaginator::withCurrentPage() (@samdark)
- Enh #207: More specific Psalm type for `OffsetPaginator::withCurrentPage()` (@samdark)
- Enh #214: Improved interface hierarchy (@samdark)
- Enh #207: More specific Psalm type for `OffsetPaginator::withCurrentPage()` parameter (@samdark)
- Enh #210: More specific Psalm type for `PaginatorInterface::getPageSize()` result (@vjik)
Expand Down
2 changes: 1 addition & 1 deletion src/Paginator/OffsetPaginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ final class OffsetPaginator implements PaginatorInterface
/**
* Data reader being paginated.
*
* @psalm-var ReadableDataInterface<TKey, TValue>&LimitableDataInterface&OffsetableDataInterface&CountableDataInterface
* @psalm-var ReadableDataInterface<TKey, TValue>&LimitableDataInterface<TKey, TValue>&OffsetableDataInterface<TKey, TValue>&CountableDataInterface
*/
private ReadableDataInterface $dataReader;

Expand Down
6 changes: 4 additions & 2 deletions src/Reader/DataReaderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
* @template TKey as array-key
* @template TValue as array|object
*
* @extends ReadableDataInterface<TKey, TValue>
* @extends LimitableDataInterface<TKey, TValue>
* @extends OffsetableDataInterface<TKey, TValue>
* @extends SortableDataInterface<TKey, TValue>
* @extends FilterableDataInterface<TKey, TValue>
* @extends IteratorAggregate<TKey, TValue>
*/
interface DataReaderInterface extends
ReadableDataInterface,
LimitableDataInterface,
OffsetableDataInterface,
CountableDataInterface,
Expand Down
5 changes: 5 additions & 0 deletions src/Reader/FilterableDataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
* {@see FilterInterface::getOperator()} is applied
*
* For performance reasons, prefer filtering as many items as possible in the first step.
*
* @template TKey as array-key
* @template TValue as array|object
*
* @extends ReadableDataInterface<TKey, TValue>
*/
interface FilterableDataInterface extends ReadableDataInterface
{
Expand Down
5 changes: 5 additions & 0 deletions src/Reader/LimitableDataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

/**
* Data that could be limited.
*
* @template TKey as array-key
* @template TValue as array|object
*
* @extends ReadableDataInterface<TKey, TValue>
*/
interface LimitableDataInterface extends ReadableDataInterface
{
Expand Down
5 changes: 5 additions & 0 deletions src/Reader/OffsetableDataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

/**
* Data that could be read from Nth item by skipping items from the beginning.
*
* @template TKey as array-key
* @template TValue as array|object
*
* @extends ReadableDataInterface<TKey, TValue>
*/
interface OffsetableDataInterface extends ReadableDataInterface
{
Expand Down
5 changes: 5 additions & 0 deletions src/Reader/SortableDataInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
/**
* A data set that could be sorted.
* The sorting set may be used by a data reader that supports sorting.
*
* @template TKey as array-key
* @template TValue as array|object
*
* @extends ReadableDataInterface<TKey, TValue>
*/
interface SortableDataInterface extends ReadableDataInterface
{
Expand Down

0 comments on commit 181335a

Please # to comment.